I'm sure I've done this previously, but how escapes me just now:
sub testit{ print 'hi' };; sub doit (&) { $_[0]->() };; $codeRef = \&testit;; doit( $codeRef );; Type of arg 1 to main::doit must be block or sub {} (not scalar derefe +rence)
Thanks.
In reply to The & prototype and code references in scalars. by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |