summaryrefslogtreecommitdiff
blob: c9e0d48e9ad06aced185fc7ac3b556628b0d8d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
https://rt.cpan.org/Public/Bug/Display.html?id=58053

--- a/lib/Mail/Mbox/MessageParser.pm
+++ b/lib/Mail/Mbox/MessageParser.pm
@@ -294,7 +294,7 @@
   dprint "Calling \"$filter_command\" to decompress file \"$file_name\".";
 
   use vars qw(*OLDSTDERR);
-  open OLDSTDERR,">&STDERR" or die "Can't save STDERR: $!\n";
+  open OLDSTDERR, ">&", \*STDERR or die "Can't save STDERR: $!\n";
   open STDERR,">" . File::Spec->devnull()
     or die "Can't redirect STDERR to " . File::Spec->devnull() . ": $!\n";
 
@@ -305,7 +305,7 @@
 
   binmode $file_handle;
 
-  open STDERR,">&OLDSTDERR" or die "Can't restore STDERR: $!\n";
+  open STDERR, ">&", \*OLDSTDERR or die "Can't restore STDERR: $!\n";
 
   if (eof($file_handle))
   {