v3.25 release
[perl/plp/.git] / lib / PLP.pm
index 54a3b91fe5eb43248f81a9f4716478e1fd6f5e43..58120fa55a1820d5c115380c92d0dfcd105b1296 100644 (file)
@@ -14,7 +14,7 @@ use File::Spec;
 use strict;
 use warnings;
 
-our $VERSION = '3.22';
+our $VERSION = '3.25';
 
 # Subs in this package:
 #  _default_error($plain, $html)    Default error handler
@@ -76,7 +76,9 @@ sub error {
                print "Status: $type\nContent-Type: text/html\n\n",
                        qq{<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html>},
                        "<head>\n<title>$type $short</title>\n</head></body>\n<h1>$short",
-                       "</h1>\n$long<p>\n<hr>\n$ENV{SERVER_SIGNATURE}</body></html>";
+                       "</h1>\n$long<p>\n<hr>\n";
+               print $ENV{SERVER_SIGNATURE} if $ENV{SERVER_SIGNATURE};
+               print "</body></html>";
        }
 }
 
@@ -92,6 +94,7 @@ sub handler {
 
 # 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) {
@@ -447,7 +450,7 @@ Originally by Juerd Waalboer <juerd@cpan.org>
 
 =head1 LICENSE
 
-Copyright (c) 2000-2002 Juerd Waalboer, 2005-2008 Mischa POSLAWSKY.
+Copyright (c) 2000-2002 Juerd Waalboer, 2005-2018 Mischa POSLAWSKY.
 All rights reserved.
 
 This software is free software;