in reply to Re: Can i stored an array in hashref?
in thread Can i stored an array in hashref?
This puts a reference to @array as the 2nd thing in the anon list that 'key' points to. If the contents of @array can vary and in real application, I presume that it will, then,my @array = ('test', 'demo', 'work'); my $value = { 'key' => ['value', \@array, 'add']; }
The above says that I am going to make copy of @array, and then assign a reference to that in this key structure. That is different than assigning a ref to the @array.'key' => ['value', [@array], 'add'];
|
|---|