Yup, not quite. sort can be called without a block, while using the & prototype means your sub has to be called with a block. Perhaps if Perl supported a prototype like [&@$] like it does \[&@$].
In reply to Re^2: Prototype like sort()?
by perlancar
in thread Prototype like sort()?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |