diff options
-rw-r--r-- | gv.c | 4 | ||||
-rw-r--r-- | lib/FileHandle.pm | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -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__ |