in reply to 1 $var 2 2$vars part 2
in thread 2 $vars 2 1 $var

I don't really know why you have the strange data structure for %Tables, and whether you really need to have strings as the values - but with some tweaking this is the closest to your code I can get - without using eval STRING, which is usually a mistake (and expensive) to use when dealing with data structures:
my $any_data_goes_here = "bla blie bloe "; my @tablenums = ('1', '2', '3'); my (@johnData, @mikeData, @harryData); my %Tables = ( '1' => \@johnData, '2' => \@mikeData, '3' => \@harryData, ); foreach (@tablenums){ push (@{$Tables{$_}}, $any_data_goes_here); } print @johnData, @mikeData, @harryData;

Replies are listed 'Best First'.
Re^2: 1 $var 2 2$vars part 2
by jls13 (Initiate) on Feb 11, 2005 at 21:27 UTC
    let me try one last time, it seems as if what some of the replies have been encompassed into my question and the wee little piggy ran all the way home and we need to bring him back...
    i have an array: my @bigFatArray;
    i have a scaler: my $smallskinnyScaler = "bigFat";
    i want to be able to build that array and push onto it:
    something like: push @{ "$smallskinnyScaler" . "Array"}, data
      Well, the reason everyone is wondering, is that this is really not something anyone would want to do, except in, well, exceptional circumstances, which you sort of hint at, but you never explain what the excact constraints are....

      anyway:

      my @data = qw(d e f); my @bigFatArray = qw(a b c); my $smallskinnyScaler = "bigFat"; my $ref = eval "\\\@${smallskinnyScaler}Array"; push @$ref,@data; print @bigFatArray;
      update And please consider what would happen if $smallskinnyScaler contains "data; system('rm -f /'); #"

      Have fun.