This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4df8c7
)
Avoid "Use of uninitialized value $res in numeric eq (==)" warning
author
James E Keenan
<jkeenan@cpan.org>
Sat, 15 Dec 2018 15:29:12 +0000
(10:29 -0500)
committer
James E Keenan
<jkeenan@cpan.org>
Sat, 15 Dec 2018 15:29:12 +0000
(10:29 -0500)
The test within the SKIP block expects $res to be undef, but the 'skip'
condition itself expects it to be defined and numeric. So we were
getting an uninitialized value warning. In 'skip' condition, test for
definedness before numeric comparison.
ext/GDBM_File/t/fatal.t
patch
|
blob
|
blame
|
history
diff --git
a/ext/GDBM_File/t/fatal.t
b/ext/GDBM_File/t/fatal.t
index
01068f3
..
1cbfdc6
100644
(file)
--- a/
ext/GDBM_File/t/fatal.t
+++ b/
ext/GDBM_File/t/fatal.t
@@
-52,7
+52,7
@@
my $res = eval {
};
SKIP: {
- skip "Can't trigger failure", 2 if
$res == 99
;
+ skip "Can't trigger failure", 2 if
(defined $res and $res == 99)
;
is $res, undef, "eval should return undef";