Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: sorting ip octets

by demerphq (Chancellor)
on Feb 16, 2005 at 18:54 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-24 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found