my $i = 0; $i++ while $stl =~ /$key1/g;
See perldoc perlre for the /g flag. And in general if you're trying to access a string character-by-character you're not thinking Perl, you're thinking C (or the like).
--
We're looking for people in ATL
In reply to Re: acessing the contents of a file character by character
by Fletch
in thread acessing the contents of a file character by character
by gvs_jagan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |