Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 ( #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
Node Status?
node history
Node Type: note [id://547150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2020-12-04 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (58 votes). Check out past polls.

    Notices?