neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
My Presentation 1() 2() 3() 4() 5()
Next Presentation 1() 2() 3() 4() 5()
There is a total of 23 presentations.
There are three peices of information I am trying to gather into a data structure:
At first I thought about this:
my %presentations = ( s1 => "My Presentation', s2 => "Next Presentation', ... s23 => 'Last Presentation', ); # Get param answers for presentations foreach $key (keys %presentations){ $pres_answ { $presentations{$key} } = param($key); }
At that point I realized that I would have a problem with order. I want to organize the answers in the same order that they appear on the form. Hashes do not retain that order. How would you go about organizing this data in order to preserve their order?
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help creating a data structure
by Zaxo (Archbishop) on Jun 28, 2005 at 18:59 UTC | |
|
Re: Help creating a data structure
by kirbyk (Friar) on Jun 28, 2005 at 18:45 UTC | |
|
Re: Help creating a data structure
by xorl (Deacon) on Jun 28, 2005 at 18:39 UTC | |
|
Re: Help creating a data structure
by fmerges (Chaplain) on Jun 28, 2005 at 21:17 UTC | |
|
Re: Help creating a data structure
by anonymized user 468275 (Curate) on Jun 29, 2005 at 09:22 UTC |