Guessing from reading the docs (!) but it looks like
selectall_hashref() is executed using the DB handle, so your code might better be:
my $hash = $dbconn->selectall_hashref($sql_statement);
You may have been led astray by the talk of preparing a statement ahead of time, but even then you still use the DB handle.
my $sth = $dbconn->prepare($sql_statement);
. . . . . . .
my $hash = $dbconn->selectall_hashref($sth);
As for setting the valuable RaiseError flag, it looks like you'll have to do that on the DB handle when using
selectall_hashref, perhaps something like:
{
local $dbconn->{RaiseError} = 1;
my $hash = $dbconn->selectall_hashref($sql_statement);
. . . . . . .
}
Go back and read the DBI docs whenever something goes 'wrong' - sometimes it takes me a couple "read again"s before it sinks in to my flat file head.