in reply to Sorting packed arays
Could you put it into a Tie::Array::Pack or Tie::Array::Packed array and just use sort?
That does not work as you expect, sort unpacks the array before sorting it.
Though, Tie::Array::Packed has a sort method that can be used for that. For instance:
tie my @p, 'Tie::Array::Packed::Integer'; push @p, $_ for (.....); tied(@p)->sort; [download]