Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Counting the number of items returned by split without using a named array

by Hue-Bond (Priest)
on May 03, 2006 at 13:38 UTC ( [id://547150]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -lpe '($_=()=/\s+/g)++'   ## leading
     foo bar
    3
    ...
     foo bar 
    4
    $ _
    
  2. or download this
    $ perl -wle 'print scalar (()=/\S+/g) for "a b c", " a b c", "a b c ",
    + " a b c "'
    3
    3
    3
    3
    $ _
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://547150]
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 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found