See require for the full story. The short version is you need to replace :: with / and append a .pm
my $modName = 'Getopt/Long.pm'; require $modName;
Update Oops, this just answers the easy part of the question! Still thinking about the second part.
In reply to Re: using a variable with require
by GrandFather
in thread using a variable with require
by geoffleach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |