[Catalyst] Questions about $c->write

Bernhard Graf catalyst2 at augensalat.de
Sat May 5 15:08:44 GMT 2007


While working on my View classes (see 
http://lists.scsys.co.uk/pipermail/catalyst/2007-May/013120.html)
I found this (sparse) description about Catalyst::Engine::write():

 Writes the buffer to the client. Can only be called once for a request.

Is the second phrase correct? I couldn't see why and at least 
finalize_body() from the same package can do many calls to write() for 
one request.


Then I'm a little confused about Catalyst::Engine::FastCGI::write():
In the source you find

*STDOUT->syswrite($buffer);

Looks like IO::Handle is loaded somewhere, but this turns out as a 
mistake, because other than documented this syswrite() doesn't return 
the number of bytes written - at least not as a Perl integer value, but 
instead returns the size as a binary value.
Because the class of this syswrite hides behind the STDOUT glob, I'm not 
able to track this bug up to the origin.

Anybody knows what's behind the file handles in this module?
-- 
Bernhard Graf



More information about the Catalyst mailing list