output multiline %headers as multiple headers of the same name
[perl/plp/.git] / lib / PLP.pm
index 42866dc20f85d110662693e0c203a55faae94615..37d95b12e9cf8389a7967c4172f6cbdc72d44510 100644 (file)
@@ -94,7 +94,10 @@ sub handler {
 sub sendheaders () {
        $PLP::sentheaders ||= [ caller 1 ? (caller 1)[1, 2] : (caller)[1, 2] ];
        print STDOUT "Content-Type: text/plain\n\n" if $PLP::DEBUG & 2;
-       print STDOUT map("$_: $PLP::Script::header{$_}\n", keys %PLP::Script::header), "\n";
+       while (my ($header, $values) = each %PLP::Script::header) {
+               print STDOUT "$header: $_\n" for split /\n/, $values;
+       }
+       print STDOUT "\n";
 }
 
 {