Nachtrag zu 3-arg open: STDOUT nicht überflüssig öffnen.
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 16 Sep 2011 15:05:19 +0000 (17:05 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 16 Sep 2011 15:05:19 +0000 (17:05 +0200)
Führte zu einem skurrilen Bug wo der :raw Layer unter cgi nicht auf STDOUT propagiert wird

SL/Form.pm

index e44f397..06a8910 100644 (file)
@@ -1410,6 +1410,7 @@ sub parse_template {
         if ($self->{OUT}) {
           open OUT, '>', $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
           print OUT while <IN>;
+          close OUT;
           seek IN, 0, 0;
 
         } else {
@@ -1424,10 +1425,8 @@ Content-Length: $numbytes
 
 |;
 
-          open(OUT, ">&", \*STDOUT) or $self->error($self->cleanup . "$!: STDOUT");
-          $::locale->with_raw_io(*OUT, sub { print while <IN> });
+          $::locale->with_raw_io(\*STDOUT, sub { print while <IN> });
         }
-        close OUT;
       }
 
       close(IN);