NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Tuesday March 25, 2003
12:02 PM
HTML::Mason trap
Following code doesn't work (i.e. it doesn't redirect):
<%def redirect>
<%init>
$m->redirect('/');
</%init>
</%def>
Component body
% $m->scomp('redirect');
But this code does work:
<%def redirect>
<%init>
$m->redirect('/');
</%init>
</%def>
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.
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Actually ... (Score:2)
But it should probably still work. I wonder if I can fix it.