diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-01-08 21:20:26 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-01-08 21:20:26 +0000 |
commit | e81465beff59e6c9907613fe00ebce59d81fb1e8 (patch) | |
tree | 4c6010205cc62e3f79dff3aa7dc7ac005ccccab8 /t/op/do.t | |
parent | 3236f110cb098d9081961e6c9f4585ecaf729cc5 (diff) | |
download | perl-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-x | t/op/do.t | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); }; |