You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2000/07/29 21:11:24 UTC

How to use warnings in Apache::ASP?

Is there a way to make it so that all Apache::ASP scripts on my site have
"use warnings;" on by default (something analogous to PerlSetVar Strict 1
and use strict;)? Or do I just have to put "use warnings;" in every file?

I searched the nodeworks.com/asp site (keyword warning/warnings) as well
as the modperl mailing list archive (keyword "warning ASP" and "warnings
ASP") but could not find anything.

-Philip Mak (pmak@aaanime.net)


Re: How to use warnings in Apache::ASP?

Posted by Joshua Chamas <jo...@chamas.com>.
Philip Mak wrote:
> 
> I just tried doing the global.asa thing, but I realized another problem.
> Recently, I installed a new version of perl on my system (upgraded 5.00503
> to 5.6). Something went wrong though; Apache::ASP is still using the old
> version of perl. If I run /usr/bin/perl, /usr/local/bin/perl, or a CGI
> script, the $] (version) variable evaluates to 5.6. But inside ASP
> scripts, the version is 5.00503 (use warnings doesn't work in 5.00503).
> 

This is because Apache::ASP uses that same perl that mod_perl does.
Just recompile your mod_perl with your new perl, and the problem
will go away!

> Would you happen to know how to find out the pathname of the perl
> executable that Apache::ASP is using? I found a file called
> /usr/bin/perl5.00503, but relinking that to perl 5.6 had no effect.
> 

I would imagine that looking at @INC would give you a hit
as to which perl you are using since the perl lib directories
tend to have build numbers & locations that are related.

> Also, does ASP have a directive for turning on -w?
> 

No.

Enjoy the upgrade!

-- Joshua
_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Re: How to use warnings in Apache::ASP?

Posted by Philip Mak <pm...@aaanime.net>.
On Sat, 29 Jul 2000, Joshua Chamas wrote:

> > Is there a way to make it so that all Apache::ASP scripts on my site have
> > "use warnings;" on by default (something analogous to PerlSetVar Strict 1
> > and use strict;)? Or do I just have to put "use warnings;" in every file?
> 
> What does it do?  Never heard of it, same as -w?

warnings.pm is a new package introduced in a recent version of perl. AFAIK
it acts just like -w.

> Does putting it into your global.asa do the trick?  Its
> the same namespace as all of your scripts unless you use
> UniquePackages setting.

I just tried doing the global.asa thing, but I realized another problem.
Recently, I installed a new version of perl on my system (upgraded 5.00503
to 5.6). Something went wrong though; Apache::ASP is still using the old
version of perl. If I run /usr/bin/perl, /usr/local/bin/perl, or a CGI
script, the $] (version) variable evaluates to 5.6. But inside ASP
scripts, the version is 5.00503 (use warnings doesn't work in 5.00503).

Would you happen to know how to find out the pathname of the perl
executable that Apache::ASP is using? I found a file called
/usr/bin/perl5.00503, but relinking that to perl 5.6 had no effect.

Also, does ASP have a directive for turning on -w?

Thanks,

-Philip Mak (pmak@aaanime.net)


RE: How to use warnings in Apache::ASP?

Posted by Douglas Wilson <do...@racesearch.com>.

> -----Original Message-----
> From: Joshua Chamas [mailto:joshua@chamas.com]
> Sent: Saturday, July 29, 2000 7:28 PM
> To: Philip Mak
> Cc: modperl@apache.org
> Subject: Re: How to use warnings in Apache::ASP?
> 
> 
> Philip Mak wrote:
> > 
> > Is there a way to make it so that all Apache::ASP scripts on my 
> site have
> > "use warnings;" on by default (something analogous to 
> PerlSetVar Strict 1
> > and use strict;)? Or do I just have to put "use warnings;" in 
> every file?
> 
> What does it do?  Never heard of it, same as -w?

warnings is NOT a module (someone called it that
in another post). Its a pragma (new, as of perl 5.6), like
'use strict', which means you can turn it on or off locally in
any block. (Or turn parts of it on or off).

HTH,
Douglas Wilson

Re: How to use warnings in Apache::ASP?

Posted by Joshua Chamas <jo...@chamas.com>.
Philip Mak wrote:
> 
> Is there a way to make it so that all Apache::ASP scripts on my site have
> "use warnings;" on by default (something analogous to PerlSetVar Strict 1
> and use strict;)? Or do I just have to put "use warnings;" in every file?
> 
> I searched the nodeworks.com/asp site (keyword warning/warnings) as well
> as the modperl mailing list archive (keyword "warning ASP" and "warnings
> ASP") but could not find anything.
> 

What does it do?  Never heard of it, same as -w?

Does putting it into your global.asa do the trick?  Its
the same namespace as all of your scripts unless you use
UniquePackages setting.

I'm thinking about a Script_OnCompile or Script_OnParse
event, maybe you could add it to all of your perl at
that time?

-- Joshua
_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051