HTML::Mason trap

IlyaM on 2003-03-25T17:02:34

Following code doesn't work (i.e. it doesn't redirect):

<%def redirect>
<%init>
$m->redirect('/');



Component body

% $m->scomp('redirect');


But this code does work:

<%def redirect>
<%init>
$m->redirect('/');



Component body

% $m->comp('redirect');


It took some time for me to realize why. Hint: $m->redirect uses $m->flush_buffer which doesn't work in components called via $m->scomp.


Actually ...

autarch on 2003-03-25T17:50:42

It's using the clear_buffer method, not flush_buffer.

But it should probably still work. I wonder if I can fix it.