Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by zshzn (Hermit)
on Feb 06, 2006 at 00:33 UTC ( #528120=note: print w/ replies, xml ) Need Help??


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

Something else worth noting is that in the event of counting the amount of single characters tr() can be used.

my $str = "here are some words"; my $count = $str =~ tr/e/e/; print "We sure do have a lot of e characters: $count\n";


Comment on Re: 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://528120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2015-07-06 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (80 votes), past polls