doorslam has asked for the wisdom of the Perl Monks concerning the following question:
I evaluate some other unrelated data here, and here's the infamous line 435 that generates the warning.my $lock = 0; $GetDataFromTable->execute($indexnumber) || die "Can't execute GetDataFromTable ($DBI::errstr)"; unless (($lock,$updon) = $GetDataFromTable->fetchrow()) { $InsertData->execute($data1,$someotherdata,1,1,0) || die "Can't execute InsertData ($DBI::errstr)"; goto DONE; }
It seems to me, the only way $lock could be uninitialized is for the fetchrow to have set it to undefined for not finding data in the table, in which case data is inserted and the line that generates the warning is skipped over. I've triedif ($lock) { # Do some other stuffDon't mess with it, it's LOCKED! } elsif(...) { ... } else (...) { ... } DONE: #Do some stuff
but it still generates the warning. The code works as I intend it to for all intents and purposes, but it spits out a lot of warnings, and I hate the idea of just shutting off the warning and ignoring it. Any ideas, and thanks. Blake Sorensenif ($lock and 1) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Yet Another Unitialized Value Question
by Zaxo (Archbishop) on Sep 22, 2003 at 18:25 UTC | |
by doorslam (Beadle) on Sep 22, 2003 at 18:49 UTC | |
by sandfly (Beadle) on Sep 22, 2003 at 20:11 UTC | |
|
Re: Yet Another Unitialized Value Question
by pijll (Beadle) on Sep 22, 2003 at 22:11 UTC | |
by doorslam (Beadle) on Sep 23, 2003 at 10:54 UTC |