in reply to Re: Sorting Hash / Array
in thread Sorting Hash / Array

What happens if you add another network to the hashref with the address 10.19,72.0/25? That will sort lexically after the others even though in numerical network order it should come first!

You need to convert the address (excluding the netmask) into something that will produce the right result when sorting lexically. The Socket module provides inet_aton() to achieve this.

Cheers,

JohnGG