T
Tore Aursand
You're not "thinking Perl" then. I find the RaiseError mechanism
to create much cleaner code. When enabled, I can do things like:
eval {
...;
...;
...;
...;
};
if ($@) {
# something went wrong with something in this section
}
whereas without RaiseError, I'm stuck setting status variables
and nesting if statements to get the same effect.
Really? Consider this code;
my $sth = $dbh->prepare( 'SELECT * FORM user' ); # typo 'FORM'
if ( $sth->execute() ) {
# Works!
}
else {
# Doesn't work!
}
$sth->finish();
I think this is cleaner, and I also suspect it to be faster than using
'eval'. Doesn't 'eval' spawn of a "mini-Perl" process, and doesn't it
take some time to run? Doesn't that hurt in a DB'ish application?