The array I want to query does not change during execution:
my @const_arr=qw( a b c d e f g);
The input is a string containing the indices I want to access, for example:
my $str ="1,4";
Is there something (besides iterating over the indices in $str) along the lines of @subarray = @const_arr[$str] that will result in @subarray containing [b,e]
?
If the indices are in a string, you can split the string to get them: