Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: ip sorting

by fokat (Deacon)
on Mar 21, 2003 at 15:53 UTC ( [id://244907]=note: print w/replies, xml ) Need Help??


in reply to ip sorting

Since TIMTOWTDI, you can also do this (slightly tested code)..

#!/usr/bin/perl use strict; use warnings; use NetAddr::IP; # Beware large IP sets... print join("\n", map { $_->addr } sort map { new NetAddr::IP $_ } <DAT +A>), "\n"; __DATA__ 10.1.5.2 10.1.1.2 10.1.0.1 10.1.1.0 10.1.1.1 10.1.5.1

Best regards

-lem, but some call me fokat

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-29 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found