Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: storing values of hash of hashes in an array based on numerical order of second key

by tybalt89 (Monsignor)
on Aug 18, 2020 at 03:32 UTC ( [id://11120867]=note: print w/replies, xml ) Need Help??


in reply to storing values of hash of hashes in an array based on numerical order of second key

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11120854 use warnings; my %pos2base2bin = ( '315' => { '8' => 0 }, '329' => { '6' => 0 }, '352' => { '5' => 0 }, '390' => { '1' => 0 }, '280' => { '7' => 1 }, '360' => { '9' => 0 }, '349' => { '4' => 0 }, '305' => { '10' => 0 }, '380' => { '3' => 1 }, '251' => { '2' => 0 } ); local ($\, $,) = ("\n", "\t"); my @items = sort { $a->[0] <=> $b->[0] } map [%$_], values %pos2base2b +in; print 'sample', map $_->[0], @items; print 'file1', map $_->[1], @items;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found