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


in reply to sorting ip octets

Pack it!

sort { unpack('N',pack('C4',split(/\./,$a))) <=> unpack('N',pack('C4',split(/\./,$b))) } @list