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.
In reply to Re: Interpolate variable name in Perl?
by Eily
in thread Interpolate variable name in Perl?
by SuzuBell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |