Your example code:

my @sorted=map { substr($_,4) } sort map { pack("LA*",tr/eE/eE/,$_) } @words;
is not quite correct; the "LA*" should be "NA*". The "L" signifies a native 32-bit unsigned integer yet to guarantee sorting correctness on all architectures you must specify "N", network (big-endian) order.


In reply to Re: Advanced Sorting - GRT - Guttman Rosler Transform by eyepopslikeamosquito
in thread Advanced Sorting - GRT - Guttman Rosler Transform by demerphq

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