diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-12 05:39:29 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-12 05:39:29 +0000 |
commit | 35cd451c5a1303394968903750cc3b3a1a6bc892 (patch) | |
tree | 0dff9ce049b3cd7facf6fbfd54dcddddc8ac0990 /pp_sys.c | |
parent | cf34019797138569fd71cfc48bb60249b9df0ec3 (diff) | |
download | perl-35cd451c5a1303394968903750cc3b3a1a6bc892.tar.gz |
fix ops that are not filehandle constructors to not create GV if it
doesn't already exist (avoids leaks); extend semantics of defined()
so that defined(*{$foo}) works (experimental)
p4raw-id: //depot/perl@2879
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1003,8 +1003,13 @@ PP(pp_select) } if (newdefout) { - if (!GvIO(newdefout)) - gv_IOadd(newdefout); + if (!GvIO(newdefout)) { + if (ckWARN(WARN_UNOPENED)) + warner(WARN_UNOPENED, "select() on unopened file"); + if (SvTYPE(newdefout) != SVt_PVGV) + RETURN; + gv_IOadd(newdefout); /* XXX probably bogus */ + } setdefout(newdefout); } |