Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl

Stop processing without generating an error message

 

 

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded


gwolf at gwolf

Aug 9, 2006, 4:32 PM

Post #1 of 3 (1394 views)
Permalink
Stop processing without generating an error message

In my main Embperl module, I added this function:

sub redirect {
# Redirect the request to a new page - and stop processing before doing any
# further harm
my ($to);
$to = shift;

$http_headers_out{Location} = $to;
exit 0;
}

That way, the moment I set a redirect by using this function, all
processing finishes - Very useful, for example, when making access
controls. And it works, too. However, calling 'exit 0' produces the
following error in the log:

[Thu Aug 10 01:08:22 2006] [error] [19700]ERR: 24: Error in Perl code: component at /home/gwolf/cvs/comas/trunk/embperl/base.pm line 156, <GEN15> line 4.\n

Of course, Embperl could not finish processing the page as it
expected. Is there a way to signal Embperl to abort processing without
filling my logs with this?

Thanks again,

--
Gunnar Wolf - gwolf [at] gwolf - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


richter at ecos

Aug 9, 2006, 9:44 PM

Post #2 of 3 (1270 views)
Permalink
RE: Stop processing without generating an error message [In reply to]

>
> That way, the moment I set a redirect by using this function,
> all processing finishes - Very useful, for example, when
> making access controls. And it works, too. However, calling
> 'exit 0' produces the following error in the log:
>
> [Thu Aug 10 01:08:22 2006] [error] [19700]ERR: 24: Error in
> Perl code: component at
> /home/gwolf/cvs/comas/trunk/embperl/base.pm line 156, <GEN15>
> line 4.\n
>

Which is line 156 in base.pm. Is it the exit 0, or is it a different line?

Gerald



** Virus checked by BB-5000 Mailfilter **


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


gwolf at gwolf

Aug 10, 2006, 8:32 AM

Post #3 of 3 (1258 views)
Permalink
Re: Stop processing without generating an error message [In reply to]

Gerald Richter dijo [Thu, Aug 10, 2006 at 06:44:38AM +0200]:
> > [Thu Aug 10 01:08:22 2006] [error] [19700]ERR: 24: Error in
> > Perl code: component at
> > /home/gwolf/cvs/comas/trunk/embperl/base.pm line 156, <GEN15>
> > line 4.\n
>
> Which is line 156 in base.pm. Is it the exit 0, or is it a different line?

Exactly, sorry for not mentioning it. Of course, if I exit with a
different value (say, 'exit 123'):

[Thu Aug 10 17:11:34 2006] [error] [19700]ERR: 24: Error in Perl code: request 123 at /home/gwolf/cvs/comas/trunk/embperl/base.pm line 156, <GEN22> line 3.\n

Greetings,

--
Gunnar Wolf - gwolf [at] gwolf - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.