Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Odd workings of split

by Jenda (Abbot)
on Mar 30, 2012 at 09:30 UTC ( #962551=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for (@cmd) {
      $_ = [split "\n", $_]->[0];
    }
    
  2. or download this
    for (@cmd) {
      $_ = (split "\n", $_)[0];
    }
    
  3. or download this
    for (@cmd) {
      s/\n.*$//s;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://962551]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-12-15 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (443 votes). Check out past polls.

    Notices?