summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-06 00:09:42 +0000
committerZefram <zefram@fysh.org>2017-12-06 00:09:42 +0000
commitf68519ee3f12e5ba41a022ef88ce3d6c3901807f (patch)
treed28e0491a89f13c137a35d52c17fb0f6e37af773 /toke.c
parent84ac76a7475419f4ac6e5a6935522f7b7ebb0e2c (diff)
downloadperl-f68519ee3f12e5ba41a022ef88ce3d6c3901807f.tar.gz
add "whereis"
"whereis" is like "whereso" except that it performs an implicit smartmatch.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index fa729382ae..e36d8a1366 100644
--- a/toke.c
+++ b/toke.c
@@ -8844,13 +8844,15 @@ Perl_yylex(pTHX)
case KEY_vec:
LOP(OP_VEC,XTERM);
+ case KEY_whereis:
case KEY_whereso:
if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_NONEXPR)
return REPORT(0);
- pl_yylval.ival = CopLINE(PL_curcop);
+ pl_yylval.ival = tmp == KEY_whereis;
+ /* diag_listed_as: whereso is experimental */
Perl_ck_warner_d(aTHX_
packWARN(WARN_EXPERIMENTAL__SMARTMATCH),
- "whereso is experimental");
+ "%" UTF8f " is experimental", UTF8fARG(UTF, len, PL_tokenbuf));
OPERATOR(WHERESO);
case KEY_while: