-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =pod Redirecting with Catalyst isn't always as straightforward as you might like. People (and very smart bots) often wonder why code like this: lang:Perl $c->res->redirect($c->uri_for('foo/bar')) if $condition; die; dies, even though C<$condition> is true. The reason is because an HTTP redirect is just a flag sent in the header. Redirections can include content (so that a user without a browser that follows C headers can perhaps click the link himself, etc.), so it's an error to call redirect and then expect the request to be over. The rest of the request cycle will run so you can populate the body and set other headers as necessary. So, if you really want to redirect NOW, you should do: $c->res->redirect($c->uri_for('foo/bar')); $c->detach(); Then the redirect will be immediate, because C<< $c->detach >> with no arguments will immediate end the request. The good news is that the next version of Catalyst will have syntax for redirect-and-end: $c->redirect('foo/bar'); This fits nicely with C and C: $c->forward ('foo/bar'); $c->detach ('foo/bar'); $c->redirect('foo/bar'); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQCVAwUBReurjtAZeFPdJeQvAQJ2CwP+OBDxKn78vFwfa32inN1bul1B/wyoqDG/ tlNxEES8AKyyURKJBTxPw4lb6J+6dICEE1nW4+vCoZqO6o+UqlCGfIIQs95HQ73/ sCninBeF7fPM0HtPqmsMt+R5qGIaOzr5Q3+lv82tQW5hd8PURyhBtzhnVGAM6yLT 4CM4oBG5YTc= =mrP2 -----END PGP SIGNATURE-----