Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Syntax Perl Version support $c = () = $a =~ /\./g

by Marshall (Canon)
on Jul 18, 2018 at 01:12 UTC ( [id://1218709]=note: print w/replies, xml ) Need Help??


in reply to Syntax Perl Version support $c = () = $a =~ /\./g

That is a rather odd statement, but completely valid since at least Perl 5.6 "mid-90's".

my @anyname = some match regex global expression; my $c = @anyname; #scalar value of number of elements in @anyname # The Goatse means the same thing but you don't have to have to # Updated spelling of Goatse, one "e", not two - Ooops thanks YourMoth +er # have the array @anyname
In general my code usually processes each match from a "match global".
I think I've used this construct before, but this is definitely not common.
More common is whether or not a match exists - not how many.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found