NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
My style -- is this wrong? (Score:2, Interesting)
if (!$dbh) {
$ok = 0;
$msg = "Failed to get connection to databasename in GetValues";
} else {
$sth = $dbh->prepare('Select * from table_name');
}
Why not just return instead of checking $ok over and over again later? I would do...
if (!$dbh) {
return (0, "Failed to get connection to databasename in GetValues", \@a);
}
$sth = $dbh->prepare('Select * from table_name');
Reply to This