The syntax of sort can't be replicated by subs.
>perl -E"say defined(prototype('CORE::sort')) ? 'can replicate' : 'can +\'t replicate'" can't replicate
The best you can do is &@.
sub mysort(&@) { my $code_ref = shift; ... } mysort { ... } ... # Same as: mysort(sub { ... }, ...)
In reply to Re: Prototype like sort()?
by ikegami
in thread Prototype like sort()?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |