Setting 'RaiseError' to 1 means 'die if there is an error'. You have two choices: eval the prepare statement and then check $@ after the prepare, or set RaiseError to 0 and check the status returned from the prepare statement.
{
local $db3->{RaiseError}=0;
$sth_minus = $db3->prepare_cached("
SELECT $column_list FROM $database_user_1.$table_names_r->[0]".
+'@'."$config{database_dblink_1}
MINUS
SELECT $column_list FROM $database_user_2.$table_names_r->[0]".
+'@'."$config{database_dblink_2}
");
warn "prepare fails with $db3->errstr" if $db3->err;
}
The errorcode is returned in $db3->err and the string in $db3->errstr not in $@.
Localising $db3->{RaiseError} is a way of locally setting the RaiseError attribute without having to rembember the state (probably not needed here, but it is a useful idiom :-).