Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: sorting hash of array of hashes by value

by Special_K (Monk)
on Sep 04, 2014 at 21:52 UTC ( #1099598=note: print w/replies, xml ) Need Help??


in reply to Re: sorting hash of array of hashes by value
in thread sorting hash of array of hashes by value

Unrelated observation: you don't use strict;, do you? I highly suggest doing so; it'll catch many mistakes. For best results, also use warnings;.

I do use strict and warnings; I just didn't copy them with that code fragment.

Unrelated observation #2: your posted code doesn't actually work, does it? Your second foreach loop iterates over the keys of %{$data_hash{$key0}}, but %data_hash is supposed to contain (references to) arrays of hashes, not hashes.

You are correct, it doesn't. In my attempt to genericize the code I accidentally introduced some typos.

  • Comment on Re^2: sorting hash of array of hashes by value

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2021-10-22 04:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?