C
carloschoenberg
With DBI, it seems that if I want to use the "?" placeholders that I
must
use prepare and execute. So I made a simple helper function to do both
for
me, saving some typing and making the code slightly cleaner:
sub sql_do($@) {
my $q = shift;
my $sth = $dbh->prepare($q);
$sth->execute(@_);
}
But I run with AutoRaise on, and when I hit a fatal error, I get a line
number
inside of sql_do(), which is rarely useful.
What should I do to get the line number of the call to sql_do() when
sql_do()'s
call to execute fails?
must
use prepare and execute. So I made a simple helper function to do both
for
me, saving some typing and making the code slightly cleaner:
sub sql_do($@) {
my $q = shift;
my $sth = $dbh->prepare($q);
$sth->execute(@_);
}
But I run with AutoRaise on, and when I hit a fatal error, I get a line
number
inside of sql_do(), which is rarely useful.
What should I do to get the line number of the call to sql_do() when
sql_do()'s
call to execute fails?