Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by japhy (Canon)
on Feb 05, 2006 at 21:23 UTC ( #528099=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl Idioms Explained - my $count = () = /.../g
in thread Perl Idioms Explained - my $count = () = /.../g

You misunderstood me. A list assignment in scalar context returns the number of elements.

my $count = (LIST1) = (LIST2);
The chunk in bold is the list assignment. That is put in scalar context by the my $count = ... part.

Please see Re: Longest repeated string... for further clarification.


Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart


Comment on Re^2: Perl Idioms Explained - my $count = () = /.../g
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-10-02 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (52 votes), past polls