Syntactic Confectionery Delight | |
PerlMonks |
This should be easy: counting letters in a stringby Anonymous Monk |
on Jan 31, 2006 at 11:23 UTC ( [id://526711]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: Hi all! My question is rather silly, but I can't seem to be able to find the solution myself... I have the array:
and the string:
and I want to find how many times each letter appears in the $string. I go like:
But it doesn't count anything... Does it have to do with the $a in the pattern matching? I tested the same thing and instead of $a I put A or B etc and it works... Code tags added by GrandFather 2006-01-31 Retitled by g0n, as per Monastery guidelines
Back to
Seekers of Perl Wisdom
|
|