SkipHuffman has asked for the wisdom of the Perl Monks concerning the following question:
This is probably a quite easy question for some, but it is just eluding me. I have a hash. Each element of the hash is a list of values. I need to move those values into an array.
This does not work:
$Hash{"Element"}='A B C D E'; my @Array=$Hash{"Element"}; #Probably syntax problem here. print "$Array[0]\n"; #expecting 'A' getting 'A B C D E'
Suggestions, Oh Wise ones?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Copying a hash element into an array as a list
by Roy Johnson (Monsignor) on Mar 24, 2004 at 17:35 UTC | |
|
Re: Copying a hash element into an array as a list
by bassplayer (Monsignor) on Mar 24, 2004 at 17:34 UTC | |
|
Re: Copying a hash element into an array as a list
by Happy-the-monk (Canon) on Mar 24, 2004 at 17:54 UTC | |
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 |