I have an Apache2/mod_perl2 system up and running.
I'm using GD to create an image on the fly, and I'm then printing it like this:
$r->content_type('image/png');
binmode STDOUT;
print $im->png;
But is this the correct way to do things in mod_perl2
?
(Ignore the f开发者_运维知识库act that I'm generating an image on the fly and not caching it etc ...)
Under mod_perl2, you should not print stuff directly to STDOUT
. Instead, use
use Apache2::Const 'OK';
$r->content_type( 'image/png' );
$r->print( $im->png );
return OK;
精彩评论