Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: RFC: Sorting IPv4 addresses

by bv (Friar)
on Oct 07, 2009 at 01:44 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-19 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found