I know that you are looking at this from another perspective but if you are indeed sorting IPs, converting them to a numerical equivalent from dotted decimal and then sorting them numerically is a slick way to go.
I didn't write it, but here is a post from dws on IP sorting. It uses pack to convert the IPs and then a sweet Orcish Maneuver to speed up the sort.
HTH
In reply to Re: Comparison result capture???
by pzbagel
in thread Comparison result capture???
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |