in reply to Re: TIMTOWTDI - printing an array
in thread TIMTOWTDI - printing an array
For that matter,
grep { print } @array;
Or even...
use List::MoreUtils qw<first>; first { not print } @array;
I can imagine many newbies scratching their heads if they saw that one! But I told it to "not print" the array! ;-)
Update: of course, there's the venerable...
print shift @array while @array;
... which prints, but also dismantles an array.
my @r;@r = reverse @array and do { print pop @r while @r }; # Now I'm just being silly!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: TIMTOWTDI - printing an array
by johngg (Canon) on Jun 20, 2012 at 23:46 UTC |