if (o->op_private & OPpHUSH_VMSISH)
sv_catpv(tmpsv, ",HUSH_VMSISH");
}
+ else if (OP_IS_FILETEST_ACCESS(o)) {
+ if (o->op_private & OPpFT_ACCESS)
+ sv_catpv(tmpsv, ",FT_ACCESS");
+ }
if (o->op_flags & OPf_MOD && o->op_private & OPpLVAL_INTRO)
sv_catpv(tmpsv, ",INTRO");
if (SvCUR(tmpsv))
#define OPpHUSH_VMSISH 64 /* hush DCL exit msg vmsish mode*/
#define OPpEXIT_VMSISH 128 /* exit(0) vs. exit(1) vmsish mode*/
+/* Private of OP_FTXXX */
+#define OPpFT_ACCESS 2 /* use filetest 'access' */
+#define OP_IS_FILETEST_ACCESS(op) \
+ (((op)->op_type) == OP_FTRREAD || \
+ ((op)->op_type) == OP_FTRWRITE || \
+ ((op)->op_type) == OP_FTREXEC || \
+ ((op)->op_type) == OP_FTEREAD || \
+ ((op)->op_type) == OP_FTEWRITE || \
+ ((op)->op_type) == OP_FTEEXEC)
+
struct op {
BASEOP
};
dSP;
#if defined(HAS_ACCESS) && defined(R_OK)
STRLEN n_a;
- if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
result = access(TOPpx, R_OK);
if (result == 0)
RETPUSHYES;
dSP;
#if defined(HAS_ACCESS) && defined(W_OK)
STRLEN n_a;
- if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
result = access(TOPpx, W_OK);
if (result == 0)
RETPUSHYES;
dSP;
#if defined(HAS_ACCESS) && defined(X_OK)
STRLEN n_a;
- if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
result = access(TOPpx, X_OK);
if (result == 0)
RETPUSHYES;
dSP;
#ifdef PERL_EFF_ACCESS_R_OK
STRLEN n_a;
- if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
result = PERL_EFF_ACCESS_R_OK(TOPpx);
if (result == 0)
RETPUSHYES;
dSP;
#ifdef PERL_EFF_ACCESS_W_OK
STRLEN n_a;
- if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
result = PERL_EFF_ACCESS_W_OK(TOPpx);
if (result == 0)
RETPUSHYES;
dSP;
#ifdef PERL_EFF_ACCESS_X_OK
STRLEN n_a;
- if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
result = PERL_EFF_ACCESS_X_OK(TOPpx);
if (result == 0)
RETPUSHYES;