Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2016-09-28 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (519 votes). Check out past polls.