Sorting IP's 
Author Message
 Sorting IP's

Can someone point me to any information about sorting IP addresses.

Derek



Wed, 23 Nov 2005 02:35:29 GMT  
 Sorting IP's

Quote:

> Can someone point me to any information about sorting IP addresses.

Without any further details given:
- perldoc -f sort
- perldoc -q sort

jue



Wed, 23 Nov 2005 02:52:24 GMT  
 Sorting IP's

Quote:

> Can someone point me to any information about sorting IP addresses.

     http://www.sysarch.com/perl/sort_paper.html

/ Gunnar

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



Wed, 23 Nov 2005 03:05:30 GMT  
 Sorting IP's

Quote:


>> Can someone point me to any information about sorting IP addresses.

>Without any further details given:
>- perldoc -f sort
>- perldoc -q sort

IP's in my mail log don't sort correctly

ie

139.134.6.87
219.91.88.21
38.184.17.254
65.214.61.97



Wed, 23 Nov 2005 03:43:30 GMT  
 Sorting IP's

Quote:

> On Sat, 07 Jun 2003 01:52:24 GMT, "Jrgen Exner"


>>> Can someone point me to any information about sorting IP addresses.

>> Without any further details given:
>> - perldoc -f sort
>> - perldoc -q sort

> IP's in my mail log don't sort correctly

> ie

> 139.134.6.87
> 219.91.88.21
> 38.184.17.254
> 65.214.61.97

What do you mean by "don't sort correctly".
This list looks sorted to me, in a nice alphabetical order.

Please define exactly what you want:
    Number A should be before number B if and only if ....

Best to do that part in a Perl function, such that it returns -1 iff A
should come before B, 0 iff they are identical, and +1 iff A should come
after B.

jue

jue

jue



Wed, 23 Nov 2005 04:58:42 GMT  
 Sorting IP's

Quote:

> IP's in my mail log don't sort correctly

> ie

> 139.134.6.87
> 219.91.88.21
> 38.184.17.254
> 65.214.61.97

Maybe this matches your definition of "sort correctly":


         $a->[1] <=> $b->[1] or
         $a->[2] <=> $b->[2] or
         $a->[3] <=> $b->[3] or
         $a->[4] <=> $b->[4]

/ Gunnar

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



Wed, 23 Nov 2005 07:18:05 GMT  
 Sorting IP's

Quote:
> Can someone point me to any information about sorting IP addresses.

A search at google groups finds the dozens of times that this
question has been asked and answered already.

Not much point to going over it all again.

 http://groups.google.com/groups?as_q=sort%20IP&as_ugroup=comp.lang.pe...

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Wed, 23 Nov 2005 15:08:33 GMT  
 Sorting IP's

Quote:

> Can someone point me to any information about sorting IP addresses.

use Net::Netmask

Almost any issue regarding IP addresses can benefit from methods in that
module.

http://search.cpan.org/author/MUIR/Net-Netmask-1.9004/Netmask.pod



Fri, 25 Nov 2005 17:55:38 GMT  
 Sorting IP's

Quote:

> Can someone point me to any information about sorting IP addresses.

http://groups.google.com/groups?hl=en&lr=&ie=ISO-8859-1&q=sort+IP+add...

Purl Gurl
--
"The name Purl Gurl comes to mind."
  - Takshaka, Perl Monks



Fri, 25 Nov 2005 18:32:20 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Sorting IP's - Help!

2. Sorting IP's

3. ping all ip's fron one file without ip's from private sector

4. Sorting ip addrs (anyone) ?

5. sorting IP addresses?

6. Sorting an array of IP addresses

7. IP address incorrect by $ENV{'REMOTE_ADDR'}

8. IP's to DN's

9. Sorting IP addresses

10. IP address incorrect by $ENV{'REMOTE_ADDR'}

11. sorting IP addresses

12. Sorting IP numbers

 

 
Powered by phpBB® Forum Software