template_error("Invalid array '\@$arrayname' does not have any elements!");
}
}
if (scalar(@item_choose) == 0) {
template_error("Invalid selection index '$item_choice' in pick statement on \@$arrayname!");
}
my $arrindex = ($item_no - 1) % scalar(@item_choose);
template_error("Use of undefined index [ $item_choose[$arrindex] ] for array index $arrindex in item choices ($item_choice)!") unless (@{ $substitutions->{$arrayname} })[ $item_choose[$arrindex] - 1 ];