Stories
Slash Boxes
Comments
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

use Perl Log In

Log In

[ Create a new account ]

Journal of IlyaM (2933)

Tuesday March 25, 2003
12:02 PM

HTML::Mason trap

[ #11228 ]
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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.