in reply to Copying a hash element into an array as a list
The monks have provided a suitable solution to your problem. However, if you could just change the base of the problem a bit, then make it
$hash{'element'} = [ "A".."E" ]; # reference to anonymous array contai +ning A-E. my @array = @{ $hash{'element'} }; # dereference and copy the array in +to @array. print "$array[0]\n", $hash{'element'}->[0], "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Copying a hash element into an array as a list
by SkipHuffman (Monk) on Mar 24, 2004 at 17:58 UTC | |
by dragonchild (Archbishop) on Mar 24, 2004 at 18:22 UTC | |
by SkipHuffman (Monk) on Mar 24, 2004 at 18:45 UTC | |
by revdiablo (Prior) on Mar 24, 2004 at 20:55 UTC |