That takes a reference to the result obtained from invoking that subroutine right there, not a reference to the subroutine itself. If you want a chance of that working, you'll want my $reg = \&subroutinename instead. But, keep reading...my $reg = \INIT();
Second, the name "INIT" is reserved. From perldoc perlmod:
"INIT" blocks are run just before the Perl runtime begins execu +tion, in "first in, first out" (FIFO) order. For example, the code gener +ators documented in perlcc make use of "INIT" blocks to initialize an +d resolve pointers to XSUBs.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re: Doing "extensions"/"addons"
by merlyn
in thread Doing "extensions"/"addons"/"plugins"
by Ace128
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |