Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by CountZero (Bishop)
on Oct 09, 2012 at 06:36 UTC ( #997930=note: print w/replies, xml ) Need Help??


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

Oops, my bad. I am so used to writing subs that return a meaningful result rather than do an in-place action-at-a-distance. MrSnrub has the right solution: just return $_ in the map.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997930]
help
Chatterbox?
[Happy-the-monk]: Discipulus: thanks! So in Ascii "CTRL" + "ARROW UP" + "<-- -->"?
[hippo]: On my tab key the left pointing arrow is directly above the right-pointing arrow (and they are each pointing at a vertical line). It's a UK keyboard.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2017-11-21 10:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?