in reply to foreach only for a section of a list
perl -e '@set=qw(a b c d);for (@set[0..$#set - 1]){print "$_\n";}' a b c
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
|
---|
In Section
Seekers of Perl Wisdom
in reply to foreach only for a section of a list
perl -e '@set=qw(a b c d);for (@set[0..$#set - 1]){print "$_\n";}' a b c
|
---|