Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Sorting Hash / Array

by salva (Abbot)
on May 21, 2012 at 14:32 UTC ( #971624=note: print w/ replies, xml ) Need Help??


in reply to Sorting Hash / Array

I have just uploaded to CPAN a new version of Sort::Key::IPv4 that can sort network addresses in the format xxx.xxx.xxx.xxx/xxx:
use Sort::Key::IPv4 qw(netipv4keysort); my %hash = ( '127' => { 'network' => '10.182.48.0/24', 'VLAN' => '3509' }, ...); my @sorted_keys = netipv4keysort { $hash{$_}{network} } keys %hash;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2016-07-27 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (243 votes). Check out past polls.