in reply to Re: foreach (each character in string..)?
in thread foreach (each character in string..)?
while ($string =~ /./gs) {
# whatever with $&
# note that this incurs the penalty for using $&
}
You can avoid the $& penalty by using parentheses:
/(.)/gs and using the $1 variable.
Arjen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: foreach (each character in string..)?
by duff (Parson) on Jan 20, 2004 at 21:21 UTC |