summaryrefslogtreecommitdiff
path: root/lib/FileHandle.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/FileHandle.pm')
-rw-r--r--lib/FileHandle.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm
index 1dc699c85b..0264b61f15 100644
--- a/lib/FileHandle.pm
+++ b/lib/FileHandle.pm
@@ -94,9 +94,9 @@ sub pipe {
}
# Rebless standard file handles
-bless *STDIN{IO}, "FileHandle";
-bless *STDOUT{IO}, "FileHandle";
-bless *STDERR{IO}, "FileHandle";
+bless *STDIN{IO}, "FileHandle" if ref *STDIN{IO} eq "IO::Handle";
+bless *STDOUT{IO}, "FileHandle" if ref *STDOUT{IO} eq "IO::Handle";
+bless *STDERR{IO}, "FileHandle" if ref *STDERR{IO} eq "IO::Handle";
1;