Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by japhy (Canon)
on Feb 04, 2006 at 19:14 UTC ( #527973=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $str = "here are some words";
    my $count = () = $str =~ /\S+/g;
    
  2. or download this
    my $last_operand = ("a", "b", "c");  # "c"
    my $true_or_false = /\w+/g;          # 1 or ""
    my $dunno = some_function();         # who knows?!
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://527973]
Approved by gmax
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2014-10-01 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (18 votes), past polls