summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-03-09 03:16:07 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-03-09 03:16:07 +0000
commit0244c3a403af2426ac6678d042024bb183ebbfa9 (patch)
tree40a351e091ccd9a2bb3b3161bc86da1768784ce2 /t
parentdce40276d967c484e2b36928ff656a2f5ac3647a (diff)
downloadperl-0244c3a403af2426ac6678d042024bb183ebbfa9.tar.gz
fix parsing of here documents in C<eval 's/.../<<FOO/e'>
p4raw-id: //depot/perl@3098
Diffstat (limited to 't')
-rwxr-xr-xt/base/lex.t30
1 files changed, 27 insertions, 3 deletions
diff --git a/t/base/lex.t b/t/base/lex.t
index 6bb39d0ae7..d90d404cac 100755
--- a/t/base/lex.t
+++ b/t/base/lex.t
@@ -1,8 +1,6 @@
#!./perl
-# $RCSfile: lex.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:04 $
-
-print "1..41\n";
+print "1..46\n";
$x = 'x';
@@ -155,6 +153,7 @@ print $foo;
# These next two tests are trying to make sure that
# $^FOO is always global; it doesn't make sense to `my' it.
#
+
eval 'my $^X;';
print "not " unless index ($@, 'Can\'t use global $^X in "my"') > -1;
print "ok 37\n";
@@ -181,4 +180,29 @@ print $foo;
}
+# see if eval '', s///e, and heredocs mix
+sub T {
+ my ($where, $num) = @_;
+ my ($p,$f,$l) = caller;
+ print "# $p:$f:$l vs /$where/\nnot " unless "$p:$f:$l" =~ /$where/;
+ print "ok $num\n";
+}
+
+my $test = 42;
+
+{
+# line 42 "plink"
+ local $_ = "not ok ";
+ eval q{
+ s/^not /<<EOT/e and T '^main:\(eval \d+\):2$', $test++;
+# fuggedaboudit
+EOT
+ print $_, $test++, "\n";
+ T('^main:\(eval \d+\):6$', $test++);
+# line 1 "plunk"
+ T('^main:plunk:1$', $test++);
+ };
+ print "# $@\nnot ok $test\n" if $@;
+ T '^main:plink:53$', $test++;
+}