diff options
author | Bram <perl-rt@wizbit.be> | 2008-07-24 20:14:27 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-08-24 14:52:12 +0000 |
commit | 777723442a58c6c86c224d8d746a30441a5bdfbd (patch) | |
tree | 45abacfc91df8bbbad01c3db7771db22c96333e9 /t/lib/warnings | |
parent | 228ee848f02d1db8db39c97ee13c0c9975afa083 (diff) | |
download | perl-777723442a58c6c86c224d8d746a30441a5bdfbd.tar.gz |
Unintented interpolation of $/ in regex (was: Re: [perl
Message-ID: <20080724181427.aiml4sdvr40k4coc@horde.wizbit.be>
Note that the Subject: has a typo - it should be $\
This adds a new warning.
I moved the tests from the original patch to t/lib/warnings/toke.
p4raw-id: //depot/perl@34224
Diffstat (limited to 't/lib/warnings')
-rw-r--r-- | t/lib/warnings/toke | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index 1bd8f8fa9c..04c41d5cf5 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -875,3 +875,18 @@ Prototype after '@' for main::proto_after_array : @$ at - line 3. Prototype after '%' for main::proto_after_hash : %$ at - line 7. Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12. Prototype after '@' for main::underscore_after_at : @_ at - line 13. +######## +# toke.c +use warnings "ambiguous"; +"foo\nn" =~ /^foo$\n/; +"foo\nn" =~ /^foo${\}n/; +my $foo = qr/^foo$\n/; +my $bar = qr/^foo${\}n/; +no warnings "ambiguous"; +"foo\nn" =~ /^foo$\n/; +"foo\nn" =~ /^foo${\}n/; +my $foo = qr/^foo$\n/; +my $bar = qr/^foo${\}n/; +EXPECT +Possible unintended interpolation of $\ in regex at - line 3. +Possible unintended interpolation of $\ in regex at - line 5. |