Some clarification on Perl's "use" semantics may be necessary.

"use SomeModule;" expects to find "SomeModule.pm" on your disc in your @INC.
If it can't find it, then you have a problem.

You may want to re-read perlmod
http://www.perldoc.com/perl5.8.4/pod/perlmod.html and take another look at
perlfunc, especially "use"
http://www.perldoc.com/perl5.8.4/pod/func/use.html

GlobalPackage just makes your ASP pages all part of the same package, which
you specify.

-- John Drago




 

-----Original Message-----
From: Nicholas Schuetz [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 19, 2004 6:31 PM
To: [EMAIL PROTECTED]
Subject: RE: View contents of loaded global.asa


OK one more thing, I was reading through the Apache::ASP documentation
trying to figure out where I went a stray and here is where I think I got
confused. This is the description for GlobalPackages:

GlobalPackage

Perl package namespace that all scripts, includes, & global.asa events are
compiled into. By default, GlobalPackage is some obscure name that is
uniquely generated from the file path of the Global directory, and
global.asa file. The use of explicitly naming the GlobalPackage is to allow
scripts access to globals and subs defined in a perl module that is included
with commands like:

  in perl script: use Some::Package;
  in apache conf: PerlModule Some::Package

  PerlSetVar GlobalPackage Some::Package

I think the line that reads, "in perl script: use Some::Package;" should be:

in perl script: package Some::Package;

Also, I never had to set the PerlModule Apache::ASP::TYPHOON directive in my
apache conf. I just set the GlobalPackage to Apache::ASP::TYPHOON, defined
my subroutines in global.asa (the global.asa was also in my Global path) and
set the package Apache::ASP::TYPHOON; line in my scripts. 

Am I doing this all wrong or does this list agree that the documentation is
misleading or incorrect?

--Nick

-----Original Message-----
From: Nicholas Schuetz [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 19, 2004 9:39 AM
To: [EMAIL PROTECTED]
Subject: RE: View contents of loaded global.asa


OK I finally figured it out. All I needed to do is specify:

package Apache::ASP::TYPHOON; 

in all source files I want to use my custom subroutines in global.asa.

Thanks,

Nick


Quoting Nicholas Schuetz <[EMAIL PROTECTED]>:

> 
> Thanks for the reply, Warren. I have already taken this aproach. I know
the
> global.asa I am working with is in fact the one being compiled. One very
> important point I need to bring up is that I have UniquePackages 1 set. If
I
> unset this my app works fine. This exact configuration use to work in
v2.19
> Apache::ASP. I am now using the latest stable version 2.57. Even when
> UniquePackages 1 is set.
> 
> I have tried explicitly naming the GlobalPackage to Apache::ASP::TYPHOON.
> When I try to use Apache::ASP::TYPHOON it says it can not find this
package.
> Therefore I can't use my custom subroutine(s). Shouldn't this  package be
> compiling during runtime? Shouldn't it be appending that packages PATH to
> @INC? Should I be putting my UniquePackaged sub routines in a file other
> than the VirtualHost specific Global/global.asa PATH/file?
> 
> Quoting Warren Young <[EMAIL PROTECTED]>:
> 
> > Nicholas Schuetz wrote:
> > > Does anyone know how I can view the contents of the global.asa 
> > > loaded
> > durring
> > > runtime. 
> > 
> > That would be chasing the symptom, not the cause.
> > 
> > Instead, convince yourself directly that the global.asa you think is 
> > running is in fact being compiled.  Add something like this to
> > Script_OnStart:
> > 
> >     print STDERR "Oooga booga\n";
> > 
> > > When I reference check_db_connection () from one of my asp files I 
> > > get an undefined sub routine error.
> > 
> > You could say this instead of the above for more info:
> > 
> >     print STDERR "Oooga booga ", ref &\check_db_connection, "\n";
> > 
> > It should say "Oooga booga CODE".
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED] For additional 
> > commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



----- End forwarded message -----



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



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




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

Reply via email to