Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by c4onastick (Friar)
on Sep 18, 2007 at 06:01 UTC ( [id://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 (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://639555]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found