The first example isn't an option because the sub in question is in a module (threads::async()). Also it defeats the most common use case of an in-line bareblock.
The latter doesn't help as I only have (multiple) coderefs at the place of use. I could use async{ $coderef->( ... ) };, but I'm not keen on the doubling of the call overhead.
I just rediscovered async \&{ $codeRef };. I'm not sure if that's equally costly.
In reply to Re^2: The & prototype and code references in scalars.
by BrowserUk
in thread The & prototype and code references in scalars.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |