Summary
PerlOnJava cannot call the DBI class method DBI->trace(0). It treats the
class name string ("DBI") as though it were a database-handle hash
reference. This prevents distributions that disable DBI tracing during
initialization from loading at all.
Reproduction
Run either backend:
./jperl -MDBI -e 'DBI->trace(0); print "ok\\n"'
./jperl --interpreter -MDBI -e 'DBI->trace(0); print "ok\\n"'
Expected output:
Actual result on both backends:
Can't use string ("DBI") as a HASH ref while "strict refs" in use at jar:PERL5LIB/DBI.pm line 1355.
The same call succeeds under system Perl with DBI 1.651.
CPAN failure that exposed the bug
The CPAN random-tester run 20260910-101908-8428 reported FAIL for
DBIx::PhraseBook 1.003. Its test file loads DBIx::PhraseBook, whose
INIT block calls:
The test process aborts before the first assertion, producing zero tests:
t/DBIx-PhraseBook.t (Wstat: 65280) ...
Tests: 0 Failed: 0
Result: FAIL
This is not a DBIx::PhraseBook-specific operation; the minimal DBI
reproducer fails without that distribution and on both PerlOnJava execution
backends.
Technical evidence
The bundled Perl implementation of DBI::trace currently begins with:
sub trace {
my ($dbh, $level, $output) = @_;
$level ||= 0;
$dbh->{TraceLevel} = $level;
...
}
For a class-method invocation, $dbh is the string "DBI". Standard DBI
accepts DBI->trace(...) as a package-level tracing operation, so the
implementation needs to distinguish class-level invocation from a
database-handle invocation, or otherwise provide compatible class-method
semantics.
Impact
Any CPAN module that calls DBI->trace(...) during module initialization can
fail to compile or load under PerlOnJava. This also masks the module's own
tests, as demonstrated by DBIx::PhraseBook.
Suggested regression coverage
Add a project-owned test that invokes DBI->trace(0) under both backends and
asserts that it completes without a hash-reference error. Include at least
one class-level trace-setting case and preserve handle-level behavior if the
implementation shares the same method.
Summary
PerlOnJava cannot call the DBI class method
DBI->trace(0). It treats theclass name string (
"DBI") as though it were a database-handle hashreference. This prevents distributions that disable DBI tracing during
initialization from loading at all.
Reproduction
Run either backend:
Expected output:
Actual result on both backends:
The same call succeeds under system Perl with DBI 1.651.
CPAN failure that exposed the bug
The CPAN random-tester run
20260910-101908-8428reportedFAILforDBIx::PhraseBook1.003. Its test file loadsDBIx::PhraseBook, whoseINITblock calls:DBI->trace(0);The test process aborts before the first assertion, producing zero tests:
This is not a DBIx::PhraseBook-specific operation; the minimal DBI
reproducer fails without that distribution and on both PerlOnJava execution
backends.
Technical evidence
The bundled Perl implementation of
DBI::tracecurrently begins with:For a class-method invocation,
$dbhis the string"DBI". Standard DBIaccepts
DBI->trace(...)as a package-level tracing operation, so theimplementation needs to distinguish class-level invocation from a
database-handle invocation, or otherwise provide compatible class-method
semantics.
Impact
Any CPAN module that calls
DBI->trace(...)during module initialization canfail to compile or load under PerlOnJava. This also masks the module's own
tests, as demonstrated by DBIx::PhraseBook.
Suggested regression coverage
Add a project-owned test that invokes
DBI->trace(0)under both backends andasserts that it completes without a hash-reference error. Include at least
one class-level trace-setting case and preserve handle-level behavior if the
implementation shares the same method.