summaryrefslogtreecommitdiff
path: root/lib/perl5db
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2012-06-30 16:40:43 +0300
committerFather Chrysostomos <sprout@cpan.org>2012-06-30 09:57:04 -0700
commit5578394101efd4d95c058c4f22f51763ae92ebc2 (patch)
tree36aaabba4310363a5261828a52dba544de205d2a /lib/perl5db
parentb81e0e290a7c5a7e7343a6f4a9baf7b6ac93475e (diff)
downloadperl-5578394101efd4d95c058c4f22f51763ae92ebc2.tar.gz
Fix perl -d’s "l" command.
The "l" command (without any arguments) got broken in blead, due to the "use strict" patch because "$max = ..." was changed into "my $max = ..." while $max should always be a global.
Diffstat (limited to 'lib/perl5db')
-rw-r--r--lib/perl5db/t/test-l-statement-18
-rw-r--r--lib/perl5db/t/test-r-statement27
2 files changed, 35 insertions, 0 deletions
diff --git a/lib/perl5db/t/test-l-statement-1 b/lib/perl5db/t/test-l-statement-1
new file mode 100644
index 0000000000..c3cf5b080e
--- /dev/null
+++ b/lib/perl5db/t/test-l-statement-1
@@ -0,0 +1,8 @@
+$x = 1;
+print "1\n";
+
+$x = 2;
+print "2\n";
+
+$x = 3;
+print "3\n";
diff --git a/lib/perl5db/t/test-r-statement b/lib/perl5db/t/test-r-statement
new file mode 100644
index 0000000000..f8c7bf5555
--- /dev/null
+++ b/lib/perl5db/t/test-r-statement
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $var = "Test";
+
+sub mysub
+{
+ my $flag = 1;
+
+ $flag = 0;
+
+ print "Foo\n";
+
+ if ($flag)
+ {
+ print "Bar\n";
+ }
+
+ return;
+}
+
+mysub();
+
+$var .= "More";
+