RE: sort ip address
by Bourgneuf Francois other posts by this author
May 25 2007 12:55AM messages near this date
view in the new Beta List Site
sort ip address
|
Re: sort ip address
@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
_____
De : perl-win32-web-bounces@[...].com [mailto:perl-win32-web-bounces@[...].com] De la part
de Kenneth Chan
Envoy� : vendredi 25 mai 2007 09:15
� : perl-win32-web@[...].com
Objet : sort ip address
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
Thread:
Kenneth Chan
Bourgneuf Francois
Kenneth Chan
|