Link to home
Start Free TrialLog in
Avatar of vikulgupta
vikulgupta

asked on

2 dimensional Hash list

Hi Guys , I am new to perl so need ur help. I have this test code can u guys tell me what is happening in this . I asume that in the push statement we r telling the code that the value of the code is going to be an array and to push the value fred into that . I am trying to print the array thereafter but can't succeed , can u help me ...
%link = ();
push (@ { $link{"testing"} }, "fred") ;
print $link{"testing"}; #prints ARRAY(0x15d505c)


ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
#or
print $link{testing}->[0];
Avatar of JustinPincar
JustinPincar

Yea, it looks as if that pushed a reference to the array stored at the memory location 0x15d505c.
I think you would need to dereference it by sticking a @ in front of it, like ozo said.