[Catalyst] Weird variable chop out of manually set response body

apv apv at sedition.com
Wed Jul 19 21:52:20 CEST 2006


I ran into a weird thing today (coming back to Catalyst after a long  
hiatus so I hope I'm not just being obtuse; I love all the changes  
I've found so far). Catalyst 5.7000, perl 5.8.6. Using test server.

This in MyApp::Controller::Word:

sub single : Path : Args(1) {
     my ( $self, $c, $word ) = @_;
     $c->response->body("Word: $word");
}

Called with http://host.local:3000/word/asdf

Gives: "Word:"

But modifying this line with a newline:
$c->response->body("Word: $word\n");

Gives the correct response: "Word: asdf"

So what gives? Expected behavior? If so, why? It didn't matter what  
the variable was either. Things like $c->response->body("Word: " .  
$c) would not make it to output either.


-Ashley




More information about the Catalyst mailing list