http://www.perlmonks.org?node_id=1059509


in reply to Interpolate variable name in Perl?

Yes you could do that with symbolic references, but you could actually just use an array @char, so that your characters would be stored in $char[0], $char[1], $char[2]. Besides, there's a simpler way to divide a string into chars : @char = split //, $string;

And if you want to have "automatic variable name" instead of "automatic variable number", you should use a hash instead of the array. Have a look at perldsc for more information on the subject.