From a250f8541c36dc9a7d6944fdbc0e05c21245d30b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 25 Mar 2012 23:29:27 +0000 Subject: reduce scope of a variable --- lib/Iurt/Process.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Iurt/Process.pm') diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm index ac5eed2..ae10e14 100644 --- a/lib/Iurt/Process.pm +++ b/lib/Iurt/Process.pm @@ -247,14 +247,14 @@ sub perform_command { my $retry = $opt{retry} || 1; my $call_ret = 1; - my ($err, $pid, $try); + my ($err, $try); my $logfile = "$opt{log}/$opt{logname}.$run->{run}.log"; my $max_retry = max($config->{max_command_retry}, $retry); while ($retry) { $try++; $logfile = "$opt{log}/$opt{logname}-$try.$run->{run}.log" if $opt{retry} > 1; - $pid = fork_to_monitor($run, $config, $logfile, %opt) if $opt{log}; + my $pid = $opt{log} ? fork_to_monitor($run, $config, $logfile, %opt) : 0; eval { # handle timeout: -- cgit v1.2.1