Summary
PerlOnJava fails Morpheus 0.46 operations involving overloaded
Morpheus::Key comparisons. The runtime attempts to dispatch the cmp
operation even though the class defines the relational overloads used by the
module (eq, lt, le, gt, and ge), and then aborts because no cmp
method is available.
CPAN regression
The CPAN random-tester run 20260910-101908-8428 recorded a regression for
Morpheus 0.46. The previous passing result was recorded on 2026-08-26 at
commit fc1332935.
Result from the current run:
26/58 subtests failed; 7/11 test programs failed
The recurring error is:
Operation "cmp": no method found, argument in overloaded package Morpheus::Key
The error is reported from Morpheus.pm while comparing configuration keys.
It causes bootstrap, cross-plugin, environment, file, import, and script
tests to fail or abort. t/key.t, which directly tests the key class, passes,
so the failure depends on the comparison context used by the larger module.
Minimal reproducer
Morpheus::Key's overload behavior can be exercised without external services
or platform prerequisites:
./jperl --interpreter -Ilib -e '
use Morpheus::Key qw(key);
sub compare { my ($a, $b) = @_; return $a le $b }
my $a = key("/foo");
my $b = key("/foo/bar");
print compare($a, $b) ? "ok\\n" : "bad\\n";
'
Expected output:
The PerlOnJava interpreter instead aborts with the missing-cmp diagnostic.
The equivalent focused test passes under system Perl. A direct JVM execution
of this reduced expression currently passes, while the archived CPAN run
fails through the default jperl path; the JVM/interpreter difference should
be retained as part of the investigation rather than assumed away.
Upstream implementation
Morpheus::Key declares these overloads:
use overload
'eq' => ...,
'lt' => \&less,
'le' => ...,
'gt' => ...,
'ge' => ...,
'""' => ...,
'@{}' => \&parts;
It intentionally does not declare cmp. Standard Perl resolves the
relational operations according to the available overloads and fallback
rules. PerlOnJava is incorrectly requiring or dispatching cmp for at least
some dynamically typed overloaded comparisons.
Impact
Morpheus configuration loading and merging is broadly broken on the affected
execution path. More generally, CPAN classes that implement relational
overloads without explicitly implementing cmp may fail when their objects
are compared through subroutine arguments, configuration traversal, or other
dynamic code paths.
Suggested fix and regression coverage
Fix overloaded comparison dispatch/fallback so eq, lt, le, gt, and
ge use the methods supplied by the package and do not require an absent
cmp overload. Preserve Perl's behavior for incomparable operands and mixed
object/string comparisons.
Add project-owned regression coverage for:
- A
Morpheus::Key comparison through a subroutine with dynamically typed
arguments, under both backends.
- The Morpheus configuration traversal that currently fails in
Morpheus.pm.
- The existing upstream Morpheus tests after the dispatch fix.
Summary
PerlOnJava fails Morpheus 0.46 operations involving overloaded
Morpheus::Keycomparisons. The runtime attempts to dispatch thecmpoperation even though the class defines the relational overloads used by the
module (
eq,lt,le,gt, andge), and then aborts because nocmpmethod is available.
CPAN regression
The CPAN random-tester run
20260910-101908-8428recorded a regression forMorpheus 0.46. The previous passing result was recorded on 2026-08-26 at
commit
fc1332935.Result from the current run:
The recurring error is:
The error is reported from
Morpheus.pmwhile comparing configuration keys.It causes bootstrap, cross-plugin, environment, file, import, and script
tests to fail or abort.
t/key.t, which directly tests the key class, passes,so the failure depends on the comparison context used by the larger module.
Minimal reproducer
Morpheus::Key's overload behavior can be exercised without external services
or platform prerequisites:
Expected output:
The PerlOnJava interpreter instead aborts with the missing-
cmpdiagnostic.The equivalent focused test passes under system Perl. A direct JVM execution
of this reduced expression currently passes, while the archived CPAN run
fails through the default
jperlpath; the JVM/interpreter difference shouldbe retained as part of the investigation rather than assumed away.
Upstream implementation
Morpheus::Key declares these overloads:
It intentionally does not declare
cmp. Standard Perl resolves therelational operations according to the available overloads and fallback
rules. PerlOnJava is incorrectly requiring or dispatching
cmpfor at leastsome dynamically typed overloaded comparisons.
Impact
Morpheus configuration loading and merging is broadly broken on the affected
execution path. More generally, CPAN classes that implement relational
overloads without explicitly implementing
cmpmay fail when their objectsare compared through subroutine arguments, configuration traversal, or other
dynamic code paths.
Suggested fix and regression coverage
Fix overloaded comparison dispatch/fallback so
eq,lt,le,gt, andgeuse the methods supplied by the package and do not require an absentcmpoverload. Preserve Perl's behavior for incomparable operands and mixedobject/string comparisons.
Add project-owned regression coverage for:
Morpheus::Keycomparison through a subroutine with dynamically typedarguments, under both backends.
Morpheus.pm.