Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Sorting on Nested Element

by BrowserUk (Patriarch)
on Sep 30, 2011 at 16:37 UTC ( [id://928854]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @keysInPriorityOrder = sort { 
        $data->{Elements}{$a}->{priority} 
        <=> 
        $data->{Elements}{$b}->{priority}
    } keys %{ $data->{Elements} };
    
  2. or download this
    for my $key ( @keysInPriorityOrder ) {
        my $subhash = $data->{Elements}{ $key };
        print $subhash->{ $_ } for qw[ Priority Name OtherVal ];
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-26 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found