in reply to Cannot Remove Redefined Warnings

The cause of this new warning is withing the perl core itself, caused this commit.

It happens only when using threads and the boot code of DBD::Oracle is called twice.

Then the boot code tries to re-install the oracle specific methods and constants using DBI's internal install_method call.

You can indeed suppress that warning in DBI.pm, using something similar to

my (undef, $filename, $line) = caller; # XXX reformat $attr as needed for _install_method my %attr = %{$attr || {}}; # copy so we can edit { no warnings "redefine"; DBI->_install_method ("DBI::${subtype}::$method", "$filename a +t line $line", \%attr); }

but that sweeps the warning under the carpet.

narrowing the scope, the warning is generated from the call cv = newXS_flags (meth_name, XS_DBI_dispatch, file)<c> in <c>DBI.xs in _install_method.

My personal opinion is that the boot code of DBD::Oracle is wrong, but at this moment, I have no idea of how to fix that.


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: Cannot Remove Redefined Warnings
by Sukhster (Sexton) on May 06, 2025 at 13:47 UTC

    Thanks for that code to suppress warnings. It worked.

    Not ideal, i.e. it does sweep the issue under the carpet. However, buys me some time to find a more elegant solution - and keep the latest code.

    Note - l did revert from 5.40.2 to 5.38.4 (from 5.38.0), and will try to upgrade again in a couple of months time.

    I have joined the DBI Mailing List to post the issue, but am waiting to get the permissions to raise it

      I think you could also address the issue by only loading DBI from the code executing in the threads.