Thank you for your quick response Chris.

That makes perfect sense. Except for the last value of 'other' which I would want at the end of the list and a choice for the person filling out the form is they did not live in the US.

Chris Devers wrote:

On Fri, 24 Sep 2004, brian larochelle wrote:



ordered hash



Hashes are, almost by definition, unordered lists of key/value pairs.


If you want to work with one in order, add a sort command to accesses:

 my @sorted_keys = sort keys %hash;

 foreach $key @sorted_keys {
   my $value = $hash{$key};
 }

etc.

Or just

 foreach $key ( sort keys %hash ) {
   my $value = $hash{$key};
 }

to skip the temp variable.

Make sense ?






-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to