Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Counting number of characters in a string

by petral (Curate)
on Mar 15, 2001 at 01:30 UTC ( #64502=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $str="There's many more ways to do it.\n";
    
    ...
    while ( $str =~ /(.)/g ) {
       $count++;
    }
    
  2. or download this
    $count2++ while chop $str;
    $count eq $count2 or warn "there's something wrong with this code.\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2014-04-17 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (441 votes), past polls