Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: fast, flexible, stable sort

by bart (Canon)
on Feb 12, 2004 at 20:46 UTC ( [id://328658] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Data::Dumper;
    $Data::Dumper::Useqq = 1;
    my @data = map "\0" x $_, 0 .. 5;
    print Dumper [ sort @data ],
      [ sort map pack("a*N", $data[$_], $_), 0 .. $#data ];
    
  2. or download this
    $VAR1 = [
              "",
    ...
              "\0\0\0\0\0\2",
              "\0\0\0\0\1"
            ];