in reply to Initialized Variable getting Uninitialized Warning
Never execute a my conditionally, and use then use declared variable under wider conditions. my $var = ... unless ...; ... $var ... is undefined behaviour.
Fix:
if (!$biuw->{const}{load_old}) { if ( my $exception = EcomImportUtilities::ageCheck( biuw => $biuw, feedpath => $feedfullpath, tablename => $TABLE ) ) { if ($exception->{exception} eq 'outofdate' || $exception->{exception} eq 'stillcopying ) { $biuw->{log}->warn( "$feedfullpath is out of date. " . "Loading stopped.\n"); return $exception; } elsif ($exception->{exception} eq 'nonexistent') { $biuw->{log}->warn( "$feedfullpath does not exist. " . "Loading stopped.\n"); return $exception; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Initialized Variable getting Uninitialized Warning
by drw (Novice) on Feb 27, 2019 at 18:17 UTC | |
by ikegami (Patriarch) on Feb 27, 2019 at 18:36 UTC | |
by drw (Novice) on Feb 27, 2019 at 19:51 UTC |