in reply to Re: Re: CGI.pm - scrolling_list and %labels hash
in thread CGI.pm - scrolling_list and %labels hash

[...] but sorted by the hash values [...]

You'd want to slip a sort into your code like ...

my @restaurantvalues = sort { $restaurant{$a} <=> $restaurant{$b} } keys %restaurant;

See the Perl FAQ How do I sort a hash (optionally by value instead of key)? for further enlightenment. :)

    --k.


Replies are listed 'Best First'.
Re: Re: Re: Re: CGI.pm - scrolling_list and %labels hash
by naChoZ (Curate) on Feb 15, 2002 at 05:05 UTC
    Kanji? Former RSN Kanji? Cool bumping into you here.

    Thanx for the input. Didn't know you were a perl monk. :) I knew I'd find a use for that spaceship operator some day.

    -Andy