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

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

by tybalt89 (Prior)
on Aug 18, 2020 at 03:32 UTC ( #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;
  • Comment on Re: storing values of hash of hashes in an array based on numerical order of second key
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2020-10-27 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (256 votes). Check out past polls.

    Notices?