Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Getting the count of a particular alphabet using subroutine

by suhailck (Friar)
on Aug 06, 2010 at 06:08 UTC ( [id://853323]=note: print w/replies, xml ) Need Help??


in reply to Getting the count of a particular alphabet using subroutine

To count the occurence of an alphabet, you can use tr as in the below code,

perl -le '$string=q[ttc actssat tb];$count=$string=~tr/t//;print $coun +t' 5


~suhail

Replies are listed 'Best First'.
Re^2: Getting the count of a particular alphabet using subroutine
by changma_ha (Sexton) on Aug 06, 2010 at 06:28 UTC

    Thanx suhailck... now my problem is solved.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-16 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found