static const char* const no_prev_lstat = "The stat preceding -l _ wasn't an lstat";
dSP;
const char *file;
+ SV* const sv = TOPs;
+ bool isio = FALSE;
if (PL_op->op_flags & OPf_REF) {
if (cGVOP_gv == PL_defgv) {
if (PL_laststype != OP_LSTAT)
- Perl_croak(aTHX_ no_prev_lstat);
+ Perl_croak(aTHX_ "%s", no_prev_lstat);
return PL_laststatval;
}
PL_laststatval = -1;
if (ckWARN(WARN_IO)) {
+ /* diag_listed_as: Use of -l on filehandle%s */
Perl_warner(aTHX_ packWARN(WARN_IO),
"Use of -l on filehandle %"HEKf,
HEKfARG(GvENAME_HEK(cGVOP_gv)));
if ((PL_op->op_private & (OPpFT_STACKED|OPpFT_AFTER_t))
== OPpFT_STACKED) {
if (PL_laststype != OP_LSTAT)
- Perl_croak(aTHX_ no_prev_lstat);
+ Perl_croak(aTHX_ "%s", no_prev_lstat);
return PL_laststatval;
- }
+ }
PL_laststype = OP_LSTAT;
PL_statgv = NULL;
- file = SvPV_flags_const_nolen(TOPs, flags);
+ if ( ( (SvROK(sv) && ( isGV_with_GP(SvRV(sv))
+ || (isio = SvTYPE(SvRV(sv)) == SVt_PVIO) )
+ )
+ || isGV_with_GP(sv)
+ )
+ && ckWARN(WARN_IO)) {
+ if (isio)
+ /* diag_listed_as: Use of -l on filehandle%s */
+ Perl_warner(aTHX_ packWARN(WARN_IO),
+ "Use of -l on filehandle");
+ else
+ /* diag_listed_as: Use of -l on filehandle%s */
+ Perl_warner(aTHX_ packWARN(WARN_IO),
+ "Use of -l on filehandle %"HEKf,
+ GvENAME_HEK((const GV *)
+ (SvROK(sv) ? SvRV(sv) : sv)));
+ }
+ file = SvPV_flags_const_nolen(sv, flags);
sv_setpv(PL_statname,file);
PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(file, '\n'))
goto doshell;
s = cmd;
- while (isALNUM(*s))
+ while (isWORDCHAR(*s))
s++; /* catch VAR=val gizmo */
if (*s == '=')
goto doshell;
PERL_ARGS_ASSERT_APPLY;
+ PERL_UNUSED_VAR(what); /* may not be used depending on compile options */
+
/* Doing this ahead of the switch statement preserves the old behaviour,
where attempting to use kill as a taint test test would fail on
platforms where kill was not defined. */
PERL_UNUSED_ARG(mark);
/* diag_listed_as: msg%s not implemented */
Perl_croak(aTHX_ "msgsnd not implemented");
+ return -1;
#endif
}
PERL_UNUSED_ARG(mark);
/* diag_listed_as: msg%s not implemented */
Perl_croak(aTHX_ "msgrcv not implemented");
+ return -1;
#endif
}
#else
/* diag_listed_as: shm%s not implemented */
Perl_croak(aTHX_ "shm I/O not implemented");
+ return -1;
#endif
}