You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by "D. L. Fox" <we...@frigginjiggy.com> on 2006/10/24 14:56:20 UTC

Global not always global?

I am moving my site to a new host. Although I thought I had it 
originally setup in a portable fashion, I have had to make changes in my 
code to allow for a different environment. One problem I have had is this:

At the top of global.asa (not inside any subs) I have the line:

our ($base_url, $Form); # running on perl 5.8.5


inside the Script_OnStart event I have:

$base_url = 'http://url/to/site';


Correct me if I'm wrong: This scalar should be global to all the scripts 
on my site, yes?

I only have one StateDir and Global directory. I'm not trying to run 
more than one ASP application, or share anything. Just one website 
running with one global.asa, etc. It is still working fine on my old 
host this way.

As soon as I try to use $base_url in another script, I get the following 
error:

error including default.inc, not compiled: maybe use strict error: 
Variable "$base_url" is not imported at /home/xxxxxx/asp/default.inc 
line 22. , /usr/lib/perl5/site_perl/5.8.7/Apache/ASP.pm line 1521

In .htaccess I have StatINC set to 1 until I can get all the bugs worked 
out. Does that have any affect on this?


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Global not always global?

Posted by Warren Young <wa...@etr-usa.com>.
D. L. Fox wrote:
> In .htaccess I have...

This is the only thing that stands out for me.  I wouldn't expect things 
like globals to work if you don't set up Apache::ASP in the main 
httpd.conf file, or some file it directly includes.  Per-directory 
configuration should only be used for overrides, not global behavior.

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org