summaryrefslogtreecommitdiff
path: root/t/op/do.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-01-08 21:20:26 +0000
committerNicholas Clark <nick@ccl4.org>2007-01-08 21:20:26 +0000
commite81465beff59e6c9907613fe00ebce59d81fb1e8 (patch)
tree4c6010205cc62e3f79dff3aa7dc7ac005ccccab8 /t/op/do.t
parent3236f110cb098d9081961e6c9f4585ecaf729cc5 (diff)
downloadperl-e81465beff59e6c9907613fe00ebce59d81fb1e8.tar.gz
do $file; won't propagate errors from die, as do is an implicit eval.
So need to propagate errors with $@. p4raw-id: //depot/perl@29723
Diffstat (limited to 't/op/do.t')
-rwxr-xr-xt/op/do.t6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/op/do.t b/t/op/do.t
index 9775331618..76d94c485a 100755
--- a/t/op/do.t
+++ b/t/op/do.t
@@ -62,21 +62,21 @@ if (open(DO, ">$$.16")) {
close DO or die "Could not close: $!";
}
-my $a = do "$$.16";
+my $a = do "$$.16"; die $@ if $@;
if (open(DO, ">$$.17")) {
print DO "ok(1, 'do in list context') if defined wantarray && wantarray\n";
close DO or die "Could not close: $!";
}
-my @a = do "$$.17";
+my @a = do "$$.17"; die $@ if $@;
if (open(DO, ">$$.18")) {
print DO "ok(1, 'do in void context') if not defined wantarray\n";
close DO or die "Could not close: $!";
}
-do "$$.18";
+do "$$.18"; die $@ if $@;
# bug ID 20010920.007
eval qq{ do qq(a file that does not exist); };