Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Re: Re: module locationby ferrency (Deacon) |
on Nov 07, 2003 at 19:07 UTC ( [id://305413]=note: print w/replies, xml ) | Need Help?? |
Well, there are a few solutions to this. My bug was: require DBI looks for "DBI.pm" because DBI is a bareword; but this does not work if you put the bareword in a variable and require that instead. One simple solution is to just:
If you don't like that, you can change the eval to a string eval, which will interpolate the package name into a bareword before require sees it:
This would be the more flexible solution, since it would handle things like ./test.pl DBD::PgSQL (assuming that makes sense... basically, any module with ::'s in it). Alan
In Section
Seekers of Perl Wisdom
|
|