in reply to Re^2: Perl Variables
in thread Perl Variables

In this case, I think a hash of hashes is definitely the way to go.

$TGS_Value{$tgs}{VAR} = \@VAR; $TGS_Value{$tgs}{STR} = \@STR; $TGS_Value{$tgs}{PER} = \@PER; $TGS_Value{$tgs}{MKT} = \@MKT; $TGS_Value{$tgs}{INS} = \@INS; $TGS_Value{$tgs}{GL} = \@GL;

Replies are listed 'Best First'.
Re^4: Perl Variables
by Nalina (Monk) on May 15, 2007 at 04:17 UTC
    How do I retrieve the values from the hash now?

      How do I retrieve the values from the hash now?

      Use the same expressions you used for assignment.

      $TGS_Value{$tgs}{VAR} = \@VAR;

      After that, $TGS_Value{$tgs}{VAR} is an array reference.

      my $var_ref = $TGS_Value{$tgs}{VAR}; my @VAR = @{$var_ref}; # ...is the same as: my @VAR = @{ $TGS_Value{$tgs}{VAR} };