common: copy plp errors on stderr
[sheet.git] / common.inc.plp
index db5177b1a2f7fbb2b681857cbc496a7a838e89d2..593adb0619d2d2b579782e888772114f412058ad 100644 (file)
@@ -12,6 +12,7 @@ use HTTP::Date;
 $PLP::ERROR = sub {
        my ($text, $html) = @_;
        print '<p class="error"><strong>Fatal error</strong>: '.$html."</p>\n\n";
+       warn $text;
 };
 
 BEGIN {
@@ -117,9 +118,9 @@ sub Html {
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="icon" type="image/png" href="/clip.png">
 EOT
-       print $_, "\n" for $meta->{stylesheet} || ();
-       print $_, "\n" for $meta->{raw} || ();
-       print qq{</head>\n\n<body id="$file">\n};
+       say for $meta->{stylesheet} || ();
+       say for $meta->{raw} || ();
+       say qq{</head>\n\n<body id="$file">};
 
        # dev indicator
        my $Dev = $ENV{HTTP_HOST} =~ /\bdev\./;