Since the latest Perl release, calling sendheaders() from within a say()
would (correctly) retain a custom output seperator, resulting in http
headers being sent incorrectly.
Easily fixed by resetting normal printing behaviour.
# Sends the headers waiting in %PLP::Script::header
sub sendheaders () {
+ local $\; # reset print behaviour if triggered by say()
$PLP::sentheaders ||= [ caller 1 ? (caller 1)[1, 2] : (caller)[1, 2] ];
print STDOUT "Content-Type: text/plain\n\n" if $PLP::DEBUG & 2;
while (my ($header, $values) = each %PLP::Script::header) {