|
List Info
Thread: RE: sort ip address
|
|
| RE: sort ip address |

|
2007-05-25 02:55:27 |
|
ip=('172.27.32.200', '172.19.32.100',
'19.1.1.60', '192.20.30.133', '172.27.32.100');
print "$_n" foreach sort
{(split '.', $a)[0]<=>(split '.', $b)[0]||(split '.',
$a)[1]<=>(split '.', $b)[1]||(split '.', $a)[2]<=>(split '.', $b)[2]||(split '.',
$a)[3]<=>(split '.', $b)[3]} ip;
19.1.1.60 172.19.32.100 172.27.32.100 172.27.32.200 192.20.30.133
Bour9
Hi,
Do you have any perl script to sort the IP
address?
172.27.32.200 172.19.32.100 10.1.1.60 192.20.30.133
thanks
|
| Re: sort ip address |

|
2007-05-30 16:34:17 |
|
Thanks Bour. This is an excellent way to sort the ip address
Thanks, Ken
On 5/25/07, Bourgneuf Francois < francois.bourgneuf groupe-mma.fr">
francois.bourgneuf groupe-mma.fr> wrote:
print "$_n" foreach sort
{(split '.';, $a)[0]<=>(split '.';, $b)[0]||(split '.';,
$a)[1]<=>(split '.';, $b)[1]||(split '.';, $a)[2]<=>(split '.9;, $b)[2]||(split '.';,
$a)[3]<=>(split '.';, $b)[3]} ip;
Bour9
De :
perl-win32-web-bounces listserv.ActiveState.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">perl-win32-web-bounces listserv.ActiveState.com
[mailto: perl-win32-web-bounces listserv.ActiveState.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">perl-win32-web-bounces listserv.ActiveState.com] De la part de
Kenneth Chan Envoyé : vendredi 25 mai 2007
09:15 À :
perl-win32-web listserv.activestate.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">perl-win32-web listserv.activestate.com Objet : sort ip
address
_______________________________________________ Perl-Win32-Web mailing list listserv.ActiveState.com">Perl-Win32-Web listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
[1-2]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|