Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: RFC: Sorting IPv4 addresses

by bv (Friar)
on Oct 07, 2009 at 01:44 UTC ( #799627=note: print w/replies, xml ) Need Help??

in reply to Re: RFC: Sorting IPv4 addresses
in thread RFC: Sorting IPv4 addresses

Thanks for some great suggestions! I'll definitely look at using Sort::Key::IPv4 in my own scripts.

The main reason I felt the need to post this was because I found the naive sort being used in a CPAN module, Nmap::Parser. I guess I expected a little better from something that gets pretty wide use. I figured it would be worthwile posting some good pure-Perl sorts, since module maintainers wouldn't have to add additional dependencies if they didn't want to. Really, why not use a drop-in replacement with almost 100% speedup?

print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2023-11-30 07:12 GMT
Find Nodes?
    Voting Booth?

    No recent polls found