perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunnar Wolf <>
Subject Stop processing without generating an error message
Date Wed, 09 Aug 2006 23:32:51 GMT
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/
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 - - (+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:
For additional commands, e-mail:

View raw message