Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: How do I dynamically declare a package name for

by hdp (Beadle)
on Apr 27, 2001 at 16:22 UTC ( [id://76050] : note . print w/replies, xml ) Need Help??


in reply to Re: How do I dynamically declare a package name for
in thread How do I dynamically declare a package name for

The caveat here is that since you're not giving require a bareword, you don't get the benefit of the filename niceties it would give you; in other words, you can't use $module = "Foo::Bar" and have require do the right thing (unless the right thing is to load a file called, literally, 'Foo::Bar').

It's been my experience that people don't really expect that, and sometimes miss the fact that the error message says "Can't find Foo::Bar in @INC..." instead of "Can't find Foo/Bar.pm in @INC..."

hdp.