STDOUT erneut öffnen unt UTF8-Flag und FastCGI gefixt
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 20 Jul 2010 09:06:11 +0000 (11:06 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 20 Jul 2010 09:06:11 +0000 (11:06 +0200)
Conflicts:

SL/Form.pm

SL/Form.pm

index bf9deb4..6fa5132 100644 (file)
@@ -1336,8 +1336,11 @@ sub parse_template {
       #print(STDERR "OUT $self->{OUT}\n");
       for my $i (1 .. $self->{copies}) {
         if ($self->{OUT}) {
-          open(OUT, $self->{OUT})
-            or $self->error($self->cleanup . "$self->{OUT} : $!");
+          open OUT, $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
+          print OUT while <IN>;
+          close OUT;
+          seek IN, 0, 0;
+
         } else {
           $self->{attachment_filename} = ($self->{attachment_filename})
                                        ? $self->{attachment_filename}
@@ -1350,18 +1353,8 @@ Content-Length: $numbytes
 
 |;
 
-          open(OUT, ">-") or $self->error($self->cleanup . "$!: STDOUT");
-
-        }
-
-        while (<IN>) {
-          print OUT $_;
-
+          $::locale->with_raw_io(\*STDOUT, sub { print while <IN> });
         }
-
-        close(OUT);
-
-        seek IN, 0, 0;
       }
 
       close(IN);