I learned this from ysth other day:
use strict; use warnings; my @num = qw( 00002 00003 00001 99999 99998 ); @num = sort { ( $a < 50000 ) <=> ( $b < 50000 ) || $a <=> $b } @num; print "sorted: @num \n"; # sorted: 99998 99999 00001 00002 00003
In reply to Re: Sorting through a rollover
by fglock
in thread Sorting through a rollover
by onegative
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |