greetings -
Let me start with a confession that I'm a newbie to perl and
modules although I've got truckloads of experience on Windows
ASP side. Anyway, I need a bit of wizdom on how to use
packages with Apache::ASP. Please read on.
In my httpd.conf I have
PerlSetVar UseStrict 1
PerlSetVar UniquePackages 0
then I have a script - called "Login.pl" - that goes like this:
<html>
<%
$Response->Include($Server->MapPath("/pls/Common/consts.pl"),"");
$Response->Write(blabla()."<BR>");
$Response->Write("A_VARIABLE=".$A_VARIABLE."<BR>");
%>
</html>
The contents of /pls/Common/consts.pl is
<%
our $A_VARIABLE = "whatever";
sub blabla {
"blabla";
}
%>
Now, when I execute Login.pl, I get this error in errors_log
"Variable "$A_VARIABLE" is not imported at Login.pl line 5."
I would like to get rid of this error without having
"PerlSetVar UseStrict 0" in httpd.conf. But how? Using
"no strict" in Login.pls does not help, and all perl
keywords "local", "my", and "our" are scoped to the current
file, eval or block. Using no keyword at all to declare
$A_VARIABLE gives the same error, but now in file consts.pl.
Should I really make a separate Perl package out of consts.pl
and then import the variables from package consts into Login.pl?
This seems a little absurd because per "PerlSetVar UniquePackages
0" in httpd.conf, both Login.pl and consts.pl are in the same
package, and there should be a simple way for any script in
the package to use variables declared in other scripts of the
package. Or am I wrong? Please let me know.
Thank you in advance
Constantine
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]