Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Runtime instantiation decisionsby Kanji (Parson) |
on Mar 30, 2002 at 17:02 UTC ( [id://155443]=note: print w/replies, xml ) | Need Help?? |
As it happens, merlyn posted something similar the other day, which you could adapt easily (untested)...
Update: ... or not. After trying out the above, I kept getting the error "autouse into different package attempted", which appears to be a known bug in autouse when using a module that isn't at the root of it's namespace (ie, Foo would work, but Foo::Bar doesn't). Perhaps merlyn has a patched version of autouse? Anyhoo, another way to do it (and as jeffa suggests) is with eval...
--k.
In Section
Seekers of Perl Wisdom
|
|