Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Sorting my hashref by value for printing a popup_menu using CGI

by jerrygarciuh (Curate)
on Jan 14, 2004 at 00:11 UTC ( [id://321148]=note: print w/replies, xml ) Need Help??


in reply to Re: Sorting my hashref by value for printing a popup_menu using CGI
in thread Sorting my hashref by value for printing a popup_menu using CGI

Roger,
Thanks for the reply but the array you create there will contain the sorted keys, not sorted values.
TA
jg
_____________________________________________________
"The man who grasps principles can successfully select his own methods.
The man who tries methods, ignoring principles, is sure to have trouble.
~ Ralph Waldo Emerson

Replies are listed 'Best First'.
Re: Re: Re: Sorting my hashref by value for printing a popup_menu using CGI
by Roger (Parson) on Jan 14, 2004 at 00:45 UTC
    The perl built-in function keys will retrieve a list of hash keys, and the built-in function values will retrieve a list of hash values.
    sort keys %$namesref # change keys to values to generate sorted list of values sort values %$namesref

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://321148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-19 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found