I am a little confused as which way to test parameters. Here are two examples from source code posted below. First is this
if(!defined($DBHdl) || !defined($ac
$sth->fetchrow_hashref will either return undef or a reference to a hash. As such
$sth->fetchrow_hashref
undef
if (defined($row))
and
if ($row)
are equivalent here. (undef is false, and reference is always true.) I opt for the simpler alternative.
Same idea for $dbh->prepare.
$dbh->prepare