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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2015-09-01 02:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (366 votes), past polls