Skip Menu |

This queue is for tickets about the PLP CPAN distribution.

Report information
The Basics
Id: 3215
Status: resolved
Priority: 0/
Queue: PLP

People
Owner: Nobody in particular
Requestors: mathieu.rt.cpan [...] closetwork.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.18
Fixed in: 3.19



Subject: PLP sends headers before it's due
PLP will send the headers whenever an inline include is made, whether or not the included files printed anything. For example: <(init.pl)><: $headers{location} = 'someurl' :> will give an error about the headers being already sent, even if init.pl was totally empty (0 length) and the above was the very first thing in the file. The fix is pretty easy, the diff is at the end of this message. Basically, the print function would call send_headers when it got two empty strings. *** /usr/lib/perl5/site_perl/5.6.1/PLP.pm Mon Aug 11 19:21:35 2003 --- PLP.pm Fri Oct 18 15:47:07 2002 *************** *** 174,180 **** # FAST printing under mod_perl sub mod_perl_print { ! return if @_ > 0 and not length join(undef,@_); PLP::sendheaders() unless $PLP::sentheaders; $PLP::r->print(@_); } --- 172,178 ---- # FAST printing under mod_perl sub mod_perl_print { ! return if @_ == 1 and not length $_[0]; PLP::sendheaders() unless $PLP::sentheaders; $PLP::r->print(@_); } *** /usr/lib/perl5/site_perl/5.6.1/PLP/Tie/Print.pm Mon Aug 11 19:22:08 2003 --- PLP/Tie/Print.pm Wed Aug 21 12:54:45 2002 *************** *** 18,24 **** sub PRINT { shift; ! return if @_ > 0 and not length join(undef,@_); PLP::sendheaders() unless $PLP::sentheaders; print STDOUT @_; select STDOUT; --- 18,24 ---- sub PRINT { shift; ! return if @_ == 1 and not length $_[0]; PLP::sendheaders() unless $PLP::sentheaders; print STDOUT @_; select STDOUT;