diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2017-06-02 17:30:22 +0100 |
---|---|---|
committer | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2017-06-05 16:06:41 +0100 |
commit | 489c16bfa14d460701bd76a4a4f0658f1200509a (patch) | |
tree | 949129fa1a01b8e7762f81215537c94d6658351a /pp_sys.c | |
parent | 9de35bb263b4599827a76615d5e6ef08fb7e32c6 (diff) | |
download | perl-489c16bfa14d460701bd76a4a4f0658f1200509a.tar.gz |
Disallow opening the same symbol as both a file and directory handle
This has been deprecated since Perl 5.10
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -629,8 +629,7 @@ PP(pp_open) IoFLAGS(GvIOp(gv)) &= ~IOf_UNTAINT; if (IoDIRP(io)) - Perl_ck_warner_d(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED), - "Opening dirhandle %" HEKf " also as a file. This will be a fatal error in Perl 5.28", + Perl_croak(aTHX_ "Cannot open %" HEKf " as a filehandle: it is already open as a dirhandle", HEKfARG(GvENAME_HEK(gv))); mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar); @@ -4021,9 +4020,8 @@ PP(pp_open_dir) IO * const io = GvIOn(gv); if ((IoIFP(io) || IoOFP(io))) - Perl_ck_warner_d(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED), - "Opening filehandle %" HEKf " also as a directory. This will be a fatal error in Perl 5.28", - HEKfARG(GvENAME_HEK(gv)) ); + Perl_croak(aTHX_ "Cannot open %" HEKf " as a dirhandle: it is already open as a filehandle", + HEKfARG(GvENAME_HEK(gv))); if (IoDIRP(io)) PerlDir_close(IoDIRP(io)); if (!(IoDIRP(io) = PerlDir_open(dirname))) |