summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-28 04:58:29 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-28 04:58:29 +0000
commit8593bda5eaf2f40ae7a609c286d223c8f721fc0d (patch)
tree1e073ef96866a8d08b7c1705857ef8eb6acf00c3 /toke.c
parent71d280e38f6b1166e3ba01f7a839868275eb4b7f (diff)
downloadperl-8593bda5eaf2f40ae7a609c286d223c8f721fc0d.tar.gz
downgrade fatal error on C<"foo@nosucharray.com"> to optional warning
(from Mark-Jason Dominus) p4raw-id: //depot/perl@6122
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index b7cceddbfb..c9b7bc5b2f 100644
--- a/toke.c
+++ b/toke.c
@@ -2149,9 +2149,14 @@ Perl_yylex(pTHX)
*/
if (pit == '@' && PL_lex_state != LEX_NORMAL && !PL_lex_brackets) {
GV *gv = gv_fetchpv(PL_tokenbuf+1, FALSE, SVt_PVAV);
- if (!gv || ((PL_tokenbuf[0] == '@') ? !GvAV(gv) : !GvHV(gv)))
- yyerror(Perl_form(aTHX_ "In string, %s now must be written as \\%s",
- PL_tokenbuf, PL_tokenbuf));
+ if ((!gv || ((PL_tokenbuf[0] == '@') ? !GvAV(gv) : !GvHV(gv)))
+ && ckWARN(WARN_AMBIGUOUS))
+ {
+ /* Downgraded from fatal to warning 20000522 mjd */
+ Perl_warner(aTHX_ WARN_AMBIGUOUS,
+ "Possible unintended interpolation of %s in string",
+ PL_tokenbuf);
+ }
}
/* build ops for a bareword */