diff options
author | 2008-09-29 17:17:50 +0000 | |
---|---|---|
committer | 2008-09-29 17:17:50 +0000 | |
commit | 850e275390052b330d93020bf619a739a3c277ac (patch) | |
tree | db372d287586cf504a5ead4801f6c6cf7eb31449 /gnu/usr.bin/perl/lib/perl5db/t/eval-line-bug | |
parent | more updates on which args do and do not mix (doc only, this time): (diff) | |
download | wireguard-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-bug | 24 |
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); |