diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-09-12 19:33:06 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-09-12 19:33:06 +0000 |
commit | 7ce6e6b9b330bcb2a1d155869572dcbf97a67971 (patch) | |
tree | 600e5d6fbf0724571575f4c1e14bebc21bbc300a /t/op/dor.t | |
parent | 40814d06efea74278848431eb06d2e8edc2b07d4 (diff) | |
download | perl-7ce6e6b9b330bcb2a1d155869572dcbf97a67971.tar.gz |
Fix a syntax incompatibility introduced by the // operator.
(Note that C<print $fh //> is still a syntax error, it
wasn't with perl 5.8.0.)
p4raw-id: //depot/perl@17900
Diffstat (limited to 't/op/dor.t')
-rw-r--r-- | t/op/dor.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/dor.t b/t/op/dor.t index 2f918fc68f..979419b986 100644 --- a/t/op/dor.t +++ b/t/op/dor.t @@ -10,7 +10,7 @@ BEGIN { package main; require './test.pl'; -plan( tests => 25 ); +plan( tests => 30 ); my($x); @@ -59,3 +59,16 @@ for (qw(getc pos readline readlink undef umask <> <FOO> <$foo> -f)) { eval "sub { $_ // 0 }"; is($@, '', "$_ // ... compiles"); } + +# Test for some ambiguous syntaxes + +eval q# sub f ($) { } f $x / 2; #; +is( $@, '' ); +eval q# sub f ($):lvalue { $y } f $x /= 2; #; +is( $@, '' ); +eval q# sub f ($) { } f $x /2; #; +like( $@, qr/^Search pattern not terminated/ ); +eval q# sub { print $fh / 2 } #; +is( $@, '' ); +eval q# sub { print $fh /2 } #; +like( $@, qr/^Search pattern not terminated/ ); |