diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-06 00:10:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-06 00:10:40 +0000 |
commit | eb6e2d6f1e269264d7937d1be23cbbe0b6820902 (patch) | |
tree | 35c59e04b4db7af027ae8dd6addaada967b4b1b6 /op.c | |
parent | 98627ae8f09f88a753760c651828da353f8c4989 (diff) | |
download | perl-eb6e2d6f1e269264d7937d1be23cbbe0b6820902.tar.gz |
optional warning on join(/foo/...) (reworked suggested patch
by Mark-Jason Dominus <mjd@plover.com>)
p4raw-id: //depot/perl@4083
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -5717,6 +5717,23 @@ Perl_ck_split(pTHX_ OP *o) } OP * +Perl_ck_join(pTHX_ OP *o) +{ + if (ckWARN(WARN_SYNTAX)) { + OP *kid = cLISTOPo->op_first->op_sibling; + if (kid && kid->op_type == OP_MATCH) { + char *pmstr = "STRING"; + if (kPMOP->op_pmregexp) + pmstr = kPMOP->op_pmregexp->precomp; + Perl_warner(aTHX_ WARN_SYNTAX, + "/%s/ should probably be written as \"%s\"", + pmstr, pmstr); + } + } + return ck_fun(o); +} + +OP * Perl_ck_subr(pTHX_ OP *o) { dTHR; |