use strict; use warnings; my @ips = qw(123.156.89.12 12.245.67.1 12.45.67.180 12.145.66.20); @ips = sort {$a cmp $b} @ips; print join "\n", @ips;
Prints:
12.145.66.20 12.245.67.1 12.45.67.180 123.156.89.12
is probably not what OP was after.
In reply to Re^2: How to sort IP addresses
by GrandFather
in thread How to sort IP addresses
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |