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.