A
Abhinav
Hi,
I have a hash variable, %table, which I populate as
my %table;
$table{'A'}{'B'}=['C','D','E'];
I now do
my $val1;
my $val2;
my $val2;
This :
($val1, $val2, $val3) = $table{'A'}{'B'}; #causes $val1, $val2 to
be undef, #$val3 = ARRAYREF
However, this :
$val1 = $table{'A'}{'B'}[0];
$val2 = $table{'A'}{'B'}[1];
$val3 = $table{'A'}{'B'}[2]; # Does the Right Thing.
Could someone point out what silly mistake I am committing in the 1st case,
and how to rectify it ?
Thanks
Abhinav
I have a hash variable, %table, which I populate as
my %table;
$table{'A'}{'B'}=['C','D','E'];
I now do
my $val1;
my $val2;
my $val2;
This :
($val1, $val2, $val3) = $table{'A'}{'B'}; #causes $val1, $val2 to
be undef, #$val3 = ARRAYREF
However, this :
$val1 = $table{'A'}{'B'}[0];
$val2 = $table{'A'}{'B'}[1];
$val3 = $table{'A'}{'B'}[2]; # Does the Right Thing.
Could someone point out what silly mistake I am committing in the 1st case,
and how to rectify it ?
Thanks
Abhinav