Ok, you can't specify which module to load via @ARGV with use. use basically works its magic at compile time, and has already done its thing before $ARGV[0] is ever determined.
No, not at all. @ARGV is available at compile time, and Perl is capable of executing expressions such as $ARGV[0] at compile time. The problem is that use expects a bareword for argument, not an expression. The generic workarounds (eval "use $ARGV[0]" and converting from namespace to filename for require) have already been posted.
In reply to Re^2: modules as variables
by ikegami
in thread modules as variables
by tcf03
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |