http://qs321.pair.com?node_id=431677

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm having trouble with this problem sorting the IP address in increasing numeric order. If the first octet is the same, sort by the second octet, if the second octet is the same sort by the third octet, etc. IP addresses have a different number of digits between the periods so you will have to split the data up.

An example is:
127.0.0.1
10.129.30.5
10.129.30.2
255.255.255.255
10.109.30.5
142.222.130.23
10.109.1.1
142.222.87.30

I can sort it by increasing to decreasing number but not by each octet.
The answer should be:
10.109.1.1
10.129.30.2
10.129.30.5
10.109.30.5
127.0.0.1
142.222.87.30
142.222.130.23
255.255.255.255

by Thank You