in reply to Accessing multiple array index

for(0..9) { print " ", $route[ $_ ]; } #or print " ", $route[ $_ ] for (0..9); #or perl -e 'my @a = qw(10 34 3 4 30 50 60 77); for(0, 2, 4, 6..7) { print + " ", $a[ $_ ]; }' perl -e 'my @a = qw(10 34 3 4 30 50 60 77); print " ", $a[ $_ ] for(0, + 2, 4, 6..7);' # will give: 10 3 30 60 77

Replies are listed 'Best First'.
Re^2: Accessing multiple array index
by GrandFather (Saint) on Jan 18, 2016 at 00:48 UTC

    The op wrote "i do not want use any sort of loop command to achieve this". How do any of your "solutions" fit this criteria?

    Premature optimization is the root of all job security