in reply to Sort ofa Print Problem

Not a direct answer to your problem, but consider using a Schwartzian transform rather than repeated splits.

my @sorted = map { $_->[1] } sort { $b->[0] <=> $a->[0] } map { [ (split(/\|/,$_))[0], $_ ] } @stats;