if (@_ == 2) { my ($type, $ref) = @_; $type =~ s/_/-/g; return sort { short_sorts($a, $b, $type) } @$ref; }