Would it be possible to declare a function that can be called like the built-in sort(), particularly:
myfunc 1, 2, 3, 4;
myfunc { $a->[0] cmp $b->[0] } 1, 2, 3, 4;
The Prototypes section in perlsub suggests that this is not possible.
In reply to Prototype like sort()? by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |