mod_perl: Modules should always be required by module name,

Max Kanat-Alexander mkanat at bugzilla.org
Thu Jun 29 13:51:40 UTC 2006


On Thu, 2006-06-29 at 06:38 -0700, Max Kanat-Alexander wrote:
> 	Instead do:
> 
> 	require "Bugzilla::Config::Common";

	Correction:

	If you have to do something like:

	require "Bugzilla/$module.pm"

	Instead do:

	eval("require Bugzilla::Config::$module") || die $@;

	That works. The reason is that normally if you use quotes in a require,
perl assumes it's a path to a file. With the "|| die $@" it works
exactly like a normal require.

	-Max
-- 
http://www.everythingsolved.com/
Competent, Friendly Bugzilla Services. And Everything Else, too.




More information about the developers mailing list