in reply to Passing a scalar and hash as subroutine arguments
Try sort keys %{ { @_[ 1 .. $#_ ] } } (Update: On second thought, don't, because there's no benefit to doing it that way – although it should work in your particular case.)