From 47ba656450de67f0bdf3e01dd920e744c2fa9218 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 31 Mar 2007 02:45:07 +0200 Subject: [PATCH] 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 --- PLP.pm | 2 +- PLP/Tie/Print.pm | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.30.0