"John D. Leonard II" wrote:
> 
> Joshua:
> 
> > The notion of application is mostly closely tied to where the global.asa
> > resides. This is configured with the PerlSetVar Global config,
> > and defaults to '.', the current directory of the executing script.
> 
> 1) Must all ASP "applications" have a .htaccess file?  A message earlier
> today suggested that existence of a .htaccess file caused a big performance
> hit.  If not, can "PerlSetVar Global wherever" be set on a per-directory
> basis in the httpd.conf?
> 

No, I only use a .htaccess in the ./site/eg samples for portability.
VirtualHost, Directory, Location tags can all have their own
PerlSetVar configs.  I use <Files> style tags in VirtualHosts personally,
so I can mix media.

> 2) How can I "localize" variables between different ASP files in the same
> application without having to resort to the PerlSetVar UniquePackages 1"?
> 

my $var = "bar"; # this is local to the script

The reason to use UniquePackages is when you want to defined subs
in scripts that might have the same name without having them conflict.
However subs should be decomped to a perl module if possible.

> For example, I have two scripts in the same directory (script1.asp and
> script2.asp) that both declare a variable (e.g.,  "my $filename =
> 'scrip1.txt'" and "my $filename='script2'").  If ASP compiles these scripts
> to the same package, is it possible to ensure that each script doesn't
> hammer on the $filename in the other script?  If not, is there a "clean" way

my scoping variables does this for you and is generally good coding
practice.  Also, set UseStrict, and this will complain about variables
not my scoped or declared as globals with "use vars qw()"

> to change the "default" package name in the ASP script with having to recode
> all subsequent perl (e.g., all $filename references to $NS1::filename and
> $NS2::filename.)
> 

You can probably do this if you need to by having ...

  package some_package;

in your script.  If you do this though, you will need to
reference ASP objects with $main::Server->Function() syntax.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks <- Web Link Checking          Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to