Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: How to call a function on each item after a split?

by nemesdani (Friar)
on Oct 08, 2012 at 15:02 UTC ( #997833=note: print w/replies, xml ) Need Help??


in reply to Re: How to call a function on each item after a split?
in thread How to call a function on each item after a split?

Yeah. More elegant and Perlish than mine.

I'm too lazy to be proud of being impatient.

Replies are listed 'Best First'.
Re^3: How to call a function on each item after a split?
by MrSnrub (Sexton) on Oct 08, 2012 at 15:42 UTC
    Why is it better to use the map?
      Map is shorter, but just as clear. Result is a list -> can be fed directly to another function.

      Just a matter of taste and choice really. TIMTOWTDI after all.

      I'm too lazy to be proud of being impatient.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997833]
help
Chatterbox?
[Eily]: I just wrote a oneliner to solve a (non perl) colleague's problem, and it worked on the first try
[Eily]: and he wasn't impressed
1nickt adds gingersnaps to the platter on the sideboard.
[Eily]: sure it was a pretty standard one liner (of the $h{$1} = $2 if /regex/; END { pp \%h; } variety), but he's not supposed to know that!
[Eily]: what's the point of writing perl if people aren't impressed :P

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2017-04-26 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (482 votes). Check out past polls.