mod_perl: "our" vs. "my" in CGI scripts

Max Kanat-Alexander mkanat at bugzilla.org
Thu Jun 22 12:56:55 UTC 2006


On Thu, 2006-06-22 at 14:43 +0200, Frédéric Buclin wrote:
> Much better is to pass $var to foo() as argument: foo($var).

	Yes, agreed.

> I think 
> only a few scripts use this kind of pseudo-global variables anyway. We 
> should fix them (e.g. process_bug.cgi and maybe token.cgi too).

	Unfortunately, many scripts assume $cgi and $template are globals. I'm
working on that now. In some scripts I'm fixing the assumption. In
others I'm making them globals, depending on whichever is easier for
now.

	The only global we should normally have is $vars. Subroutines do have a
real reason to modify that.

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




More information about the developers mailing list