Summary
PerlOnJava cannot load Mojolicious 9.49 because the parser rejects valid Perl in Mojo::Loader::find_packages:
return sort map { /^(.+)::$/ ? "${ns}::$1" : () } keys %{"${ns}::"};
The error is:
Missing comma after first argument to return
This causes WebService-Rollbar-Notifier 1.002011 to fail its load tests.
Reproduction
Archived CPAN run: 20260924-085657-82687
Target distribution: WebService-Rollbar-Notifier-1.002011
The target fails 2 of 3 tests in t/00-load.t while loading Mojo::UserAgent and WebService::Rollbar::Notifier. The failure reproduces on both the JVM and interpreter backends.
A minimal load reproducer is:
PERL5LIB=<Mojolicious-lib> ./jperl -MMojo::Loader -e 'print "loaded\\n"'
PERL5LIB=<Mojolicious-lib> ./jperl --interpreter -MMojo::Loader -e 'print "loaded\\n"'
Both report the diagnostic at Mojo/Loader.pm line 37. System Perl loads the same module successfully.
Expected behavior
Mojo::Loader should compile successfully. System Perl passes Mojolicious 9.49's complete suite (4,194 tests) and the Rollbar distribution's 5 tests.
Suspected cause
The regression appears related to the indirect return map/grep diagnostic added in commit d4ebdd9b4 (fix: diagnose indirect map arguments to return). The diagnostic logic appears to treat return sort map ... as an invalid indirect map argument, although the intervening sort makes this valid Perl.
Requested fix
Restrict the diagnostic to actual indirect return NAME map/grep ... forms while preserving valid list operators such as return sort map .... Add a focused regression test for the Mojolicious expression and retain the existing diagnostic coverage.
Summary
PerlOnJava cannot load Mojolicious 9.49 because the parser rejects valid Perl in
Mojo::Loader::find_packages:The error is:
This causes
WebService-Rollbar-Notifier1.002011 to fail its load tests.Reproduction
Archived CPAN run:
20260924-085657-82687Target distribution:
WebService-Rollbar-Notifier-1.002011The target fails 2 of 3 tests in
t/00-load.twhile loadingMojo::UserAgentandWebService::Rollbar::Notifier. The failure reproduces on both the JVM and interpreter backends.A minimal load reproducer is:
Both report the diagnostic at
Mojo/Loader.pmline 37. System Perl loads the same module successfully.Expected behavior
Mojo::Loadershould compile successfully. System Perl passes Mojolicious 9.49's complete suite (4,194 tests) and the Rollbar distribution's 5 tests.Suspected cause
The regression appears related to the indirect
return map/grepdiagnostic added in commitd4ebdd9b4(fix: diagnose indirect map arguments to return). The diagnostic logic appears to treatreturn sort map ...as an invalid indirect map argument, although the interveningsortmakes this valid Perl.Requested fix
Restrict the diagnostic to actual indirect
return NAME map/grep ...forms while preserving valid list operators such asreturn sort map .... Add a focused regression test for the Mojolicious expression and retain the existing diagnostic coverage.