in reply to iterating through scalar
But the "usual" way is
for my $c (split //, $string) { print $c; }
Alternatively:
while ( $string =~ m/(.)/g ){ print $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: iterating through scalar
by AnomalousMonk (Archbishop) on Feb 06, 2015 at 19:46 UTC |