in reply to How to split a string
Well, generally, you may be better using an array. This can be done quite easily with:
@f = split //, $s; # Now, each char is in $f[0], $f[1], etc.
If you absolutely must have seperated variables, you would have to venture into symbolic dereferencing <insert standard security warnings here>.
my $i = 0; ${'f' . $i ++} = $_ for split //, $s
This code is untested, but should work ;-)
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to split a string
by Red_Dragon (Beadle) on Jan 28, 2005 at 21:38 UTC |