$str = 'hello'; for $c (split(//,$str)) { print "c=$c\n"; }However, usually in perl its better to use pattern matching to find something in a string.
Programming Tips - perl: split a string into characters so I can look at each one
Date: 2011jul7
Language: perl
Q. perl: split a string into characters so I can look at each one
A. Use split() with // as the pattern. For example: