is equivalent touse Module qw(somesub);
BEGIN { require Module; Module->import('somesub') if Module->can('import'); }
You've prooved that require Module; works, and there's no reason to believe if Module->can('import') fails, so we're left with Module->import('somesub'). My bet is that importing works, but it's importing to the wrong namespace. Look into which namespace is used for once vs init. If the following work, my hypothesis is confirmed:
<%once> # warn("once: " . __PACKAGE__ . "\n"); require Module; # or: use Module (); # but not: use Module; # An empty list disables import, # but ommiting the list does not. </%once> ... ... ... <%init> # warn("init: " . __PACKAGE__ . "\n"); Module->import(qw(somesub)); ... &somesub(xxx); </%init>
In reply to Re: Weird Exporter Problem in Mason with mod_perl2
by ikegami
in thread Weird Exporter Problem in Mason with mod_perl2
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |