in reply to How to split a string
If you really must use separate variables, you could use the string form of eval, but this is generally considered bad style:my @array = split //, $s;
Both approaches are quite brittle and rely on your string only having one digit per target variable.no strict 'vars'; for (split //, $s) { eval "\$f$i = $_"; ++$i }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to split a string
by Aristotle (Chancellor) on Jan 28, 2005 at 21:06 UTC |