Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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;
Comment on Re: Sorting Hash / Array
Select or Download Code

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 examining the Monastery: (8)
As of 2016-05-05 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?