In BEGIN{ require $module; }, you need to replace '::' by '/' since the automatic replacement magic only occurs for barewords. See require for details. For import, the replacement is unwanted, since the package name is its argument.
As for getting things defined before they're needed, you just have to make sure that happens. You'll wind up with a bigger BEGIN block.
The use keyword is unusable for this, it truly doesn't accept a variable as a module name.
After Compline,
Zaxo
In reply to Re: use/require $MODULE (a variable)
by Zaxo
in thread use/require $MODULE (a variable)
by cadphile
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |