Re: sorting a hash / 2008-06-01



Gunnar Hjalmarsson <noreply@xxxxxxxxx> wrote in news:6aacqtF36ku0jU1
@mid.individual.net:

dn.perl@xxxxxxxxx wrote:

....

The problem is that
the city-names are one extra level deep with the state-name coming
in-between. I wondered whether I should build the hash differently.

Probably. This is one idea:

my %hash = (
'San Jose' => {
state => 'Calif',
max_temp => 84,
},
'San Fran' => {
state => 'Calif',
max_temp => 94,
},
);

http://en.wikipedia.org/wiki/Athens_(town),_New_York

http://en.wikipedia.org/wiki/Athens,_Georgia

Sinan

--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
.