sub sort_arrayref { my ($aref) = @_; return [ sort { $a <=> $b } @$aref ]; }