Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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
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 contemplating the Monastery: (6)
As of 2014-11-28 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (199 votes), past polls