summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c4
-rw-r--r--lib/FileHandle.pm5
2 files changed, 8 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 6c912a0e9b..8b38bbe19e 100644
--- a/gv.c
+++ b/gv.c
@@ -827,7 +827,9 @@ newIO()
sv_upgrade((SV *)io,SVt_PVIO);
SvREFCNT(io) = 1;
SvOBJECT_on(io);
- iogv = gv_fetchpv("IO::Handle::", TRUE, SVt_PVHV);
+ iogv = gv_fetchpv("FileHandle::", FALSE, SVt_PVHV);
+ if (!iogv)
+ iogv = gv_fetchpv("IO::Handle::", TRUE, SVt_PVHV);
SvSTASH(io) = (HV*)SvREFCNT_inc(GvHV(iogv));
return io;
}
diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm
index 0b5d9edcb4..1dc699c85b 100644
--- a/lib/FileHandle.pm
+++ b/lib/FileHandle.pm
@@ -93,6 +93,11 @@ sub pipe {
($r, $w);
}
+# Rebless standard file handles
+bless *STDIN{IO}, "FileHandle";
+bless *STDOUT{IO}, "FileHandle";
+bless *STDERR{IO}, "FileHandle";
+
1;
__END__