diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-10-18 20:57:43 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-10-18 20:57:43 +0000 |
commit | 7294df96f6c174861cfdbe3e109c745792c2be60 (patch) | |
tree | de94cc8b217405f10011ed73905e1cf78426f23f /toke.c | |
parent | 4e577f8b7504b9d2fd0f1c34f337e0edce2c4b9b (diff) | |
download | perl-7294df96f6c174861cfdbe3e109c745792c2be60.tar.gz |
Force _ to be always a bareword after filetest operators
p4raw-id: //depot/perl@25799
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -4272,11 +4272,16 @@ Perl_yylex(pTHX) /* If not a declared subroutine, it's an indirect object. */ /* (But it's an indir obj regardless for sort.) */ + /* Also, if "_" follows a filetest operator, it's a bareword */ - if ( !immediate_paren && (PL_last_lop_op == OP_SORT || + if ( + ( !immediate_paren && (PL_last_lop_op == OP_SORT || ((!gv || !GvCVu(gv)) && (PL_last_lop_op != OP_MAPSTART && PL_last_lop_op != OP_GREPSTART)))) + || (PL_tokenbuf[0] == '_' && PL_tokenbuf[1] == '\0' + && ((PL_opargs[PL_last_lop_op] & OA_CLASS_MASK) == OA_FILESTATOP)) + ) { PL_expect = (PL_last_lop == PL_oldoldbufptr) ? XTERM : XOPERATOR; goto bareword; |