wolis has asked for the wisdom of the Perl Monks concerning the following question:
I'm sure Perl can do this, yet searching the PODs and PerlMonks Q&A comes tantilisingly close, but not close enough. I just cant find a simple explanation/example for this.
I want to store a list of things into one element of a hash, and another list in another hash etc..
First off lets just try putting one list into one hash element:
Any help or explanation would be great!my @test = ( qw / bing bong bang / ); print '['.$test[2].'] ['.$test[1].'] ['.$test[0]."]\n"; $bits{'one'}= @test; my @new = $bits{'one'}; print '['.$new[2].'] ['.$new[1].'] ['.$new[0]."]\n"; OUTPUT: [bang] [bong] [bing] [] [] [3]
Thanks,
___ /\__\ "What is the world coming to?" \/__/ www.wolispace.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A hash of lists
by pg (Canon) on Nov 06, 2003 at 03:52 UTC | |
|
Re: A hash of lists
by Roger (Parson) on Nov 06, 2003 at 03:53 UTC | |
|
Re: A hash of lists
by jweed (Chaplain) on Nov 06, 2003 at 03:58 UTC | |
by sauoq (Abbot) on Nov 06, 2003 at 05:42 UTC | |
by wolis (Scribe) on Nov 06, 2003 at 22:42 UTC | |
by jweed (Chaplain) on Nov 06, 2003 at 23:09 UTC | |
by QM (Parson) on Nov 06, 2003 at 23:41 UTC | |
|
Re: A hash of lists
by Coruscate (Sexton) on Nov 06, 2003 at 05:08 UTC | |
|
(shockme) Re: A hash of lists
by shockme (Chaplain) on Nov 06, 2003 at 04:04 UTC | |
|
Re: A hash of lists
by tcf22 (Priest) on Nov 06, 2003 at 03:52 UTC | |
|
Re: A hash of lists
by Anonymous Monk on Nov 06, 2003 at 03:54 UTC | |
|
Re: A hash of lists
by Roy Johnson (Monsignor) on Nov 06, 2003 at 19:10 UTC |