From: Vincent Pit Date: Mon, 16 Nov 2015 13:50:47 +0000 (-0200) Subject: Make sure $version is not set when no suitable valgrind was found X-Git-Tag: v1.18~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=0b935f05c60bef64abcb94f2c879d76565ae2b4f;p=perl%2Fmodules%2FTest-Valgrind.git Make sure $version is not set when no suitable valgrind was found This doesn't change anything but makes things clearer. --- diff --git a/lib/Test/Valgrind/Session.pm b/lib/Test/Valgrind/Session.pm index d222f11..7a05238 100644 --- a/lib/Test/Valgrind/Session.pm +++ b/lib/Test/Valgrind/Session.pm @@ -132,13 +132,14 @@ sub new { for my $path (@paths) { next unless defined($path) and MM->maybe_command($path); my $output = qx/$path --version/; - $version = do { + my $ver = do { local $@; eval { Test::Valgrind::Version->new(command_output => $output) }; }; - if (defined $version) { - next if defined $min_version and $version < $min_version; + if (defined $ver) { + next if defined $min_version and $ver < $min_version; $valgrind = $path; + $version = $ver; last; } }