in reply to How to split a string

Yes, but a better approach might be to use an array:
my @array = split //, $s;
If you really must use separate variables, you could use the string form of eval, but this is generally considered bad style:
no strict 'vars'; for (split //, $s) { eval "\$f$i = $_"; ++$i }
Both approaches are quite brittle and rely on your string only having one digit per target variable.

Replies are listed 'Best First'.
Re^2: How to split a string
by Aristotle (Chancellor) on Jan 28, 2005 at 21:06 UTC

    You don't need to pull out the tactical nuke for this.

    my $i = 0; for( split //, $s ) { no strict 'refs'; ${ 'f' . $i++ } = $_ }

    Makeshifts last the longest.