Here's my try:

Update: As I see, Razorblade was first :D
use warnings; use strict; + my @middle = qw( 49998 49999 50000 50001 50002 50003 ); my @limit = qw( 99997 99998 99999 00001 00002 00003 ); + use Data::Dumper; print "MIDDLE\n"; print Dumper sort ro @middle; print "LIMIT\n"; print Dumper sort ro @limit; + sub ro { ( abs($a - $b) > 5000 ? $b <=> $a : $a <=> $b ) }
gives me:
MIDDLE $VAR1 = 49998; $VAR2 = 49999; $VAR3 = 50000; $VAR4 = 50001; $VAR5 = 50002; $VAR6 = 50003; LIMIT $VAR1 = 99997; $VAR2 = 99998; $VAR3 = 99999; $VAR4 = '00001'; $VAR5 = '00002'; $VAR6 = '00003';
hope that helps;phay

In reply to Re^2: Sorting through a rollover by phaylon
in thread Sorting through a rollover by onegative

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.