logo       

Weird bug - Redirect failing when eval inside a DESTROY method: msg#00160

web.mason.user

Subject: Weird bug - Redirect failing when eval inside a DESTROY method

This is a weird one.. it took me a while to figure it out but I've got
it down to a fairly basic example. I believe it's a bug unless I'm
suffering a major brainfart and missing something obvious...

I'll try sum it up as best I can:

<%init>
my $xyz = new TestObj;
$m->redirect('test2.html');
</%init>

The above will fail if TestObj has a DESTROY method, and within that
DESTROY method is an eval {} block. What will happen is that the
redirect will fail, and it will carry on with business as usual as far
as autohandlers are concerned (tho the flush_buffer has already done
what it's supposed to.) There will be a Location: header in the HTTP
response as there should be, however the status will be 200 instead of
302 or whatever the redirect header is...

I've attached a bunch of files that should reproduce the error (they do
here in any case.)

Any info would be appreciated... hopefully I've included enough
information, let me know if any other info is needed.

Apache/1.3.26
mod_perl/1.27
Mason/1.21

Thanks!

David Boone
dave@xxxxxxxxxx

Attachment: TestObj.pm
Description: Text document

Attachment: test.autohandler
Description: Text document

INSIDE test.html <%flags> inherit => 'test.autohandler' <%init> use TestObj; #my $x = new TestObj || die; $m->redirect('test2.html'); worked back <%flags> inherit => undef

Attachment: signature.asc
Description: This is a digitally signed message part

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise