in reply to foreach (each character in string..)?
orfor my $i (0..length($string)-1) { # whatever with substr($string, $i, 1) }
while ($string =~ /./gs) { # whatever with $& # note that this incurs the penalty for using $& }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: foreach (each character in string..)?
by Aragorn (Curate) on Jan 20, 2004 at 21:14 UTC | |
by duff (Parson) on Jan 20, 2004 at 21:21 UTC | |
|
Re: Re: foreach (each character in string..)?
by revdiablo (Prior) on Jan 20, 2004 at 20:20 UTC | |
by Roy Johnson (Monsignor) on Jan 20, 2004 at 20:35 UTC |