Perl-Sensitive Sunglasses | |
PerlMonks |
Re^2: while(<>) { ... } considered harmfulby Aristotle (Chancellor) |
on Sep 08, 2002 at 05:15 UTC ( [id://195983]=note: print w/replies, xml ) | Need Help?? |
Because something like
my @idx = map /(id\d+)/, @items;
is a lot more natural than
(which is already pushing legibility). Basically when you build one list out of another, non-destructively, map is the ticket. It can be in other cases as well, but those can often go either way. Makeshifts last the longest.
In Section
Meditations
|
|