Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl Idioms Explained - my $count = () = /.../g

by truedfx (Monk)
on Feb 07, 2006 at 15:27 UTC ( #528530=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!perl -l
    
    my $str = "here are some words";
    my $count = @{[ $str =~ /\S+/g ]};
    print $count;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://528530]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2017-12-13 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (377 votes). Check out past polls.

    Notices?