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

RE: Sorting a list of IP addresses (aka Why I hate Big O)

by Maqs (Deacon)
on Aug 03, 2000 at 22:01 UTC ( #26039=note: print w/ replies, xml ) Need Help??


in reply to Sorting a list of IP addresses (aka Why I hate Big O)

I'd try another solution :)
why not to read all IP adresses, convert them to binary,
for each part do:

join "", unpack "B8", pack "I" , $value;

, getting rid of '.' (couse now they play no role)
write these adresses to a txt file and then sort them execing external 'sort'?
Then convert them back to decimal , '.'-separated.. and voi la...
I havent tested that, but it seems to me it'll be quicker.

/Maqs.


Comment on RE: Sorting a list of IP addresses (aka Why I hate Big O)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2015-07-06 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (69 votes), past polls