in reply to Re^2: Why do we need $a and $b to be special?
in thread Why do we need $a and $b to be special?

Agree with you re: prototypes. I don't think you can do it with a code block specified after "sort", you actually have to declare a sub. (However, in general you can attach prototypes to coderefs by putting the prototype between "sub" and the code block.)

I think this was implemented because without it you can't very well use a sort subroutine from another package, since it will be looking at that package's $a and $b, while sort will be setting the current package's $a and $b.

  • Comment on Re^3: Why do we need $a and $b to be special?