Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: while(<>) { ... } considered harmful

by Aristotle (Chancellor)
on Sep 08, 2002 at 05:15 UTC ( #195983=note: print w/replies, xml ) Need Help??


in reply to Re: while(<>) { ... } considered harmful
in thread while(<>) { ... } considered harmful

Because something like my @idx = map /(id\d+)/, @items;
is a lot more natural than
my @idx; /(id\d+)/ && push @idx, $1 for @items;
(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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://195983]
help
Chatterbox?
[Corion]: Ouch! It seems that MacOS "High Sierra" doesn't handle fork() calls while there are threads running. I'm not really sure whether one should mix fork and threads though...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2017-10-19 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (253 votes). Check out past polls.

    Notices?