summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-29 08:22:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-29 08:22:49 +0000
commit5f2d631d316df23ef6c85417f986072d5c8e5834 (patch)
tree379f9695ef0d210f17975cdbf1d2f97368abe0f0 /gv.c
parent127ad2b7f46b3b186ffbada86b1d7dda9ffd2a05 (diff)
downloadperl-5f2d631d316df23ef6c85417f986072d5c8e5834.tar.gz
prefer IO::Handle for IO if FileHandle:: is empty (as suggested by
Tim Bunce) p4raw-id: //depot/perl@2380
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index beffabfce0..85ac8f9c34 100644
--- a/gv.c
+++ b/gv.c
@@ -875,7 +875,8 @@ newIO(void)
SvREFCNT(io) = 1;
SvOBJECT_on(io);
iogv = gv_fetchpv("FileHandle::", FALSE, SVt_PVHV);
- if (!iogv)
+ /* unless exists($main::{FileHandle}) and defined(%main::FileHandle::) */
+ if (!(iogv && GvHV(iogv) && HvARRAY(GvHV(iogv))))
iogv = gv_fetchpv("IO::Handle::", TRUE, SVt_PVHV);
SvSTASH(io) = (HV*)SvREFCNT_inc(GvHV(iogv));
return io;