in reply to Variable Names and References

Aren't we all missing the obvious answer given to us by the compiler?
You just need to use no strict 'refs';.
... { no stict 'refs'; for (1..3) { my $ref = \${'str'.$_}; print "The string is $$ref"; } } ...
or, as other people suggested, just use a hash.

Replies are listed 'Best First'.
Re^2: Variable Names and References
by Joost (Canon) on Mar 10, 2007 at 16:19 UTC