in reply to Re: DBI connect problem
in thread DBI connect problem
intoif (!defined($dbh) ) { $errStr .= " [dbh UNDEFINED]".$testStr; $self->log_comment("ERROR: db_connect => ".$errStr); } else { $errStr .= " [dbh DEFINED]".$testStr; }
Idea of this refactoring is that if you have an if/else construct it makes sense to swap branches if it simplifies the condition.if (defined $dbh) { $errStr .= " [dbh DEFINED]".$testStr; } else { $errStr .= " [dbh UNDEFINED]".$testStr; $self->log_comment("ERROR: db_connect => ".$errStr); }
--
Ilya Martynov
(http://martynov.org/)
|
|---|