Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: sorting ip octets

by demerphq (Chancellor)
on Feb 16, 2005 at 18:54 UTC ( #431679=note: print w/replies, xml ) Need Help??


in reply to sorting ip octets

Convert the ips to integers (there are built in functions for this) and then sort the integers, then convert them back to text form ips.

---
demerphq

Replies are listed 'Best First'.
Re^2: sorting ip octets
by Anonymous Monk on Feb 16, 2005 at 18:59 UTC
    I have no problem in converting them to integers, is going from column to column.

      Have a look at the Socket module which has tools for converting IP addresses into their integer form and back. inet_aton() and inet_ntoa() come to mind...

      ---
      demerphq

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2022-08-16 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?