in reply to The & prototype and code references in scalars.
or:sub testit{ print 'hi' };; sub doit (\&) { $_[0]->() };; my $codeRef = \&testit;; doit( &$codeRef );
I've a thing about prototypes, don't ya just love em!sub doit2 (&) { $_[0]->() }; doit2( sub { print 'hi2' });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The & prototype and code references in scalars.
by BrowserUk (Patriarch) on Feb 17, 2010 at 20:47 UTC | |
by LanX (Saint) on Feb 17, 2010 at 21:51 UTC | |
by BrowserUk (Patriarch) on Feb 18, 2010 at 00:17 UTC | |
by LanX (Saint) on Feb 18, 2010 at 00:25 UTC |