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)
%link = ();
push (@ { $link{"testing"} }, "fred") ;
print $link{"testing"}; #prints ARRAY(0x15d505c)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
I think you would need to dereference it by sticking a @ in front of it, like ozo said.
print $link{testing}->[0];