Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Counting matches.

by sh1tn (Priest)
on Dec 07, 2007 at 12:39 UTC ( #655635=note: print w/replies, xml ) Need Help??


in reply to Counting matches.

Use intermediate list context:
print (($counter = () = /a/g) >= 3 ? 'more' : 'less');


Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655635]
help
Chatterbox?
LanX open (You are not allowed to open to a command that pipes both in and out, but see IPC::Open2, IPC::Open3, and Bidirectional Communication with Another Process in perlipc for alternatives.)
[jdporter]: IPC::Open2, I guess
[jdporter]: yes, that
[pryrt]: 1nickt: academically, perl -MDevel::Peek -lE 'Dump(42); Dump(42.0)'
[chacham]: have you ever wanted to vote -- on a post because of the signature?
[LanX]: susure
[LanX]: good night! :)

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2017-05-24 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?