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: (6)
As of 2014-12-21 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls