diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-30 07:48:59 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-30 07:48:59 +0000 |
commit | abc718f2ca5cfe66c838e1324c1c153a085fea8b (patch) | |
tree | 23211c9fc93b1552429344d0efc4a0a611dd54ac /pp_sys.c | |
parent | 37723ebb3f0f145b85438cb89891a2c80a5f149e (diff) | |
download | perl-abc718f2ca5cfe66c838e1324c1c153a085fea8b.tar.gz |
Add two deprecation warnings:
Opening dirhandle %s also as a file
Opening filehandle %s also as a directory
p4raw-id: //depot/perl@30780
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -538,10 +538,15 @@ PP(pp_open) if (!isGV(gv)) DIE(aTHX_ PL_no_usym, "filehandle"); + if ((io = GvIOp(gv))) { MAGIC *mg; IoFLAGS(GvIOp(gv)) &= ~IOf_UNTAINT; + if (IoDIRP(io) && ckWARN2(WARN_IO, WARN_DEPRECATED)) + Perl_warner(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED), + "Opening dirhandle %s also as a file", GvENAME(gv)); + mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar); if (mg) { /* Method's args are same as ours ... */ @@ -3769,6 +3774,9 @@ PP(pp_open_dir) if (!io) goto nope; + if ((IoIFP(io) || IoOFP(io)) && ckWARN2(WARN_IO, WARN_DEPRECATED)) + Perl_warner(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED), + "Opening filehandle %s also as a directory", GvENAME(gv)); if (IoDIRP(io)) PerlDir_close(IoDIRP(io)); if (!(IoDIRP(io) = PerlDir_open(dirname))) |