summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2008-09-29 17:17:50 +0000
committermillert <millert@openbsd.org>2008-09-29 17:17:50 +0000
commit850e275390052b330d93020bf619a739a3c277ac (patch)
treedb372d287586cf504a5ead4801f6c6cf7eb31449 /gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug
parentmore updates on which args do and do not mix (doc only, this time): (diff)
downloadwireguard-openbsd-850e275390052b330d93020bf619a739a3c277ac.tar.xz
wireguard-openbsd-850e275390052b330d93020bf619a739a3c277ac.zip
import perl 5.10.0 from CPAN
Diffstat (limited to 'gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug')
-rw-r--r--gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug24
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug b/gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug
new file mode 100644
index 00000000000..cf6346e9aa6
--- /dev/null
+++ b/gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+#
+# This code is used by lib/perl5db.t !!!
+#
+
+my $i = 5;
+eval "
+#line 5 script.pl
+\$i = 10;
+";
+
+for my $q (1 .. 10) {
+ $i += $q;
+}
+
+sub factorial
+{
+ my $i = shift;
+ return +($i < 2) ? 1 : $i*factorial($i-1);
+}
+
+my $j = 4;
+$j = factorial($j);
+$j = factorial(10);