Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Sorting a hash of IP addresses?

by gbarr (Monk)
on Dec 05, 2001 at 18:34 UTC ( [id://129606]=note: print w/replies, xml ) Need Help??


in reply to Sorting a hash of IP addresses?

A simple solution would be to pack the IPs as if you were passing them to the socket routines. In this format the IP will be 4 bytes, where each byte is the numbers from the IP
use Socket; @sortedKeys = map { inet_ntoa($_) } sort map { inet_aton($_) } keys %hash;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-24 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found