From: Mischa POSLAWSKY Date: Sat, 31 Mar 2007 00:45:07 +0000 (+0200) Subject: fix header sending for tied printing X-Git-Tag: 3.19~10 X-Git-Url: http://git.shiar.net/perl/plp/.git/commitdiff_plain/47ba656450de67f0bdf3e01dd920e744c2fa9218 fix header sending for tied printing Headers were not sent on initial printf or print with empty first argument. plp.tieprint.patch by Shiar 2002-08-21 18:54:45 --- diff --git a/PLP.pm b/PLP.pm index 6d6a520..57292ad 100644 --- a/PLP.pm +++ b/PLP.pm @@ -172,7 +172,7 @@ sub mod_perl_init { # FAST printing under mod_perl sub mod_perl_print { - return if @_ == 1 and not length $_[0]; + return unless grep length, @_; PLP::sendheaders() unless $PLP::sentheaders; $PLP::r->print(@_); } diff --git a/PLP/Tie/Print.pm b/PLP/Tie/Print.pm index 8ec4e4a..83b5c76 100644 --- a/PLP/Tie/Print.pm +++ b/PLP/Tie/Print.pm @@ -18,7 +18,7 @@ sub WRITE { undef } sub PRINT { shift; - return if @_ == 1 and not length $_[0]; + return unless grep length, @_; PLP::sendheaders() unless $PLP::sentheaders; print STDOUT @_; select STDOUT; @@ -26,6 +26,8 @@ sub PRINT { sub PRINTF { shift; + return unless length $_[0]; + PLP::sendheaders() unless $PLP::sentheaders; printf STDOUT @_; select STDOUT; }