Re: Can't use Apache::exit() in command-line scripts

2000-05-12 Thread Doug MacEachern

On Fri, 5 May 2000, Bill Moseley wrote:

> At 12:05 AM 05/04/00 -0700, Doug MacEachern wrote:
> >you're calling exit in a module?  shame on you.  if you call exit() from a
> >script that is compiled by Apache::Registry (not include *.pm), exit()
> >will be overridden for you to call Apache::exit, no changes needed.
> >if you really want to call it in a module, which you really don't, do you?
> 
> I'm a bit confused.
> 
> When you say "module" you mean a module use'd by the Apache::Registry
> script?  Because exit() is overridden in those modules, too, no?
> 
> I can call exit() fine in a module, but if I say CORE::exit() the child is
> killed off.

yeah, i forgot, mod_perl uses CORE::GLOBAL:: to override it everywhere.





Re: Can't use Apache::exit() in command-line scripts

2000-05-05 Thread Bill Moseley

At 12:05 AM 05/04/00 -0700, Doug MacEachern wrote:
>you're calling exit in a module?  shame on you.  if you call exit() from a
>script that is compiled by Apache::Registry (not include *.pm), exit()
>will be overridden for you to call Apache::exit, no changes needed.
>if you really want to call it in a module, which you really don't, do you?

I'm a bit confused.

When you say "module" you mean a module use'd by the Apache::Registry
script?  Because exit() is overridden in those modules, too, no?

I can call exit() fine in a module, but if I say CORE::exit() the child is
killed off.




Bill Moseley
mailto:[EMAIL PROTECTED]



Re: Can't use Apache::exit() in command-line scripts

2000-05-03 Thread Doug MacEachern

On Wed, 3 May 2000, Franco Finstad wrote:

> I have a large modperl site with modperl (CGI) scripts and command-line perl
> scripts.
> 
> My command line scripts load modules (.pm files) that use Apache::exit().
> This is giving me the following errors:
> 
> **
> Bareword "Apache::exit" not allowed while "strict subs" in use at
> as/mod/Util.pm
>  line 546
> **

you're calling exit in a module?  shame on you.  if you call exit() from a
script that is compiled by Apache::Registry (not include *.pm), exit()
will be overridden for you to call Apache::exit, no changes needed.
if you really want to call it in a module, which you really don't, do you?

try something like:

use subs qw(exit)

*exit = $ENV{MOD_PERL} ? \&Apache::exit : sub { CORE::exit };






Re: Can't use Apache::exit() in command-line scripts

2000-05-03 Thread Jeff Beard

You should post the code in question. Your message isn't very clear but if 
I was to guess, you're trying to run a regular ol' command line Perl script 
under Apache::Registry which has more than a few caveats.

--Jeff

At 04:00 PM 5/3/00, Franco Finstad wrote:
>I have a large modperl site with modperl (CGI) scripts and command-line perl
>scripts.
>
>My command line scripts load modules (.pm files) that use Apache::exit().
>This is giving me the following errors:
>
>**
>Bareword "Apache::exit" not allowed while "strict subs" in use at
>as/mod/Util.pm
>  line 546
>**
>
>So, how can I get the command-line scripts to run under Apache::Registry?
>Adding 'use Apache;' to my command-line scripts obviously doesn't help.
>
>Any help is greatly appreciated.
>
>Here's my set up.
>modperl 1.21
>Apache 1.36
>Solaris 2.7



Jeff Beard
_
Web:www.cyberxape.com
Email:  jeff at cyberxape.com
Location:   Boulder, CO, USA