in reply to 1 $var 2 2$vars part 2
in thread 2 $vars 2 1 $var
use strict; use warnings; use Data::Dumper; my @tablenums = ('1', '2', '3'); our (@johnData, @mikeData, @harryData); my @any = ("any", "data", "goes", "here"); my %Tables = ( '1' => "john", '2' => "mike", '3' => "harry", ); foreach (@tablenums){ no strict 'refs'; push @{"$Tables{$_}Data"}, @any; } print Dumper(\(@johnData, @mikeData, @harryData));
Further reading: Symbolic references
I do not know what I may appear to the world; but to myself I seem to have been only like a boy playing on the seashore, and diverting myself in now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me.
-- Isaac Newton
|
|---|