in reply to Ampersand changes behavior of subroutine

As you are passing an explicit subroutine name to sort it takes that as the sorting operation. Remove the sort entirely (or don't pass it the subroutine name eg. by using the leading ampersand) and everything works fine.

So, it's a feature - not a bug.

  • Comment on Re: Ampersand changes behavior of subroutine

Replies are listed 'Best First'.
Re^2: Ampersand changes behavior of subroutine
by w8lle (Novice) on Feb 08, 2019 at 09:50 UTC

    Yes, that did the trick! :-)

    Thank you very much!