perl -MData::Dumper -e ' @ar1 = qw( a b c d e ); @sl = qw( b d ); @ar2 = @ar1[@sl]; print Dumper \@ar2;' #### $VAR1 = [ 'a', 'c', 'e' ];