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

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

by ikegami (Patriarch)
on Sep 18, 2007 at 04:16 UTC ( [id://639544]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @points = map { s/\s+//; $_ } split(/\t/, $_);
    
  2. or download this
    my @points = map { local $_ = $_; s/\s+//; $_ } split(/\t/, $_);
    
  3. or download this
    use List::MoreUtils qw( apply );
    my @points = apply { s/\s+// } split(/\t/, $_);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found