in reply to A problem sorting numbers with sort()

I would do this like:
sub sortData { my $dataType = pop; if($dataType eq 'Integer' || $dataType eq 'Float') { sort {$a <=> $b} @_; } else { sort @_; } }