Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Splitting on tabs then removing extra white space with map

by c4onastick (Friar)
on Sep 18, 2007 at 06:01 UTC ( #639555=note: print w/ replies, xml ) Need Help??


in reply to Re: Splitting on tabs then removing extra white space with map
in thread Splitting on tabs then removing extra white space with map

Ah! Thank you! That makes much more sense. I tried every context permutation between map and split I could think of.

Modifying $_ in map is a bad idea.

I though this was one of map's strengths? Am I mistaken?


Comment on Re^2: Splitting on tabs then removing extra white space with map
Replies are listed 'Best First'.
Re^3: Splitting on tabs then removing extra white space with map
by ikegami (Pope) on Sep 18, 2007 at 12:50 UTC
    In what situation would it be a strength? map is usually used as
    my @new = map { ... } @old;

    By changing $_, you *also* change @old in non-obvious manner.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://639555]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-29 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls