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

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

Replies are listed 'Best First'.
Re^3: 1 $var 2 2$vars part 2
by Joost (Canon) on Feb 11, 2005 at 21:41 UTC
    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.