How can I use a variable as a variable name in Perl?
Whenever you find yourself postfixing variable names with an integer index, realize that you should have used an array instead: my @msgs = (‘msg1’, ‘msg2’, …, ‘msg6’); my @vals = ( [ @val1 ], [ @val2 ], …, [ @val6 ] ); See also the FAQ How can I use a variable as a variable … Read more