summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/pp_sys.c b/pp_sys.c
index d540535d32..b1ce18a100 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2726,12 +2726,10 @@ PP(pp_stat)
if (PL_op->op_flags & OPf_REF) {
gv = cGVOP_gv;
if (PL_op->op_type == OP_LSTAT) {
+ if (gv != PL_defgv)
+ Perl_croak(aTHX_ "You can't use lstat() on a filehandle");
if (PL_laststype != OP_LSTAT)
Perl_croak(aTHX_ "The stat preceding lstat() wasn't an lstat");
- if (ckWARN(WARN_IO) && gv != PL_defgv)
- Perl_warner(aTHX_ WARN_IO,
- "lstat() on filehandle %s", GvENAME(gv));
- /* Perl_my_lstat (-l) croak's on filehandle, why warn here? */
}
do_fstat: