diff --git a/src/main/java/org/perlonjava/core/Configuration.java b/src/main/java/org/perlonjava/core/Configuration.java index d71db60ec..c2d338cba 100644 --- a/src/main/java/org/perlonjava/core/Configuration.java +++ b/src/main/java/org/perlonjava/core/Configuration.java @@ -33,7 +33,7 @@ public final class Configuration { * Automatically populated by Gradle/Maven during build. * DO NOT EDIT MANUALLY - this value is replaced at build time. */ - public static final String gitCommitId = "7f674c424"; + public static final String gitCommitId = "63c473e40"; /** * Git commit date of the build (ISO format: YYYY-MM-DD). @@ -48,7 +48,7 @@ public final class Configuration { * Parsed by App::perlbrew and other tools via: perl -V | grep "Compiled at" * DO NOT EDIT MANUALLY - this value is replaced at build time. */ - public static final String buildTimestamp = "Apr 12 2026 19:31:33"; + public static final String buildTimestamp = "Apr 12 2026 20:39:23"; // Prevent instantiation private Configuration() { diff --git a/src/main/java/org/perlonjava/runtime/perlmodule/DynaLoader.java b/src/main/java/org/perlonjava/runtime/perlmodule/DynaLoader.java index 56e76a88a..ebe20deda 100644 --- a/src/main/java/org/perlonjava/runtime/perlmodule/DynaLoader.java +++ b/src/main/java/org/perlonjava/runtime/perlmodule/DynaLoader.java @@ -37,11 +37,16 @@ public static RuntimeList bootstrap(RuntimeArray args, int ctx) { ).getList(); } - String module = args.getFirst().toString(); - return WarnDie.die( - new RuntimeScalar("Can't load module " + module), - new RuntimeScalar("\n") - ).getList(); + // Delegate to XSLoader::load() which has a multi-stage fallback: + // 1. Java XS class found → initialize and return true + // 2. @ISA has functional parent → return true (inheritance fallback) + // 3. ::PP companion loaded → return true + // 4. die with "Can't load loadable object..." (matches /loadable object/ + // pattern that CPAN modules use to detect XS failure and fall back) + // + // This makes DynaLoader-based modules (Image::Magick, Tk, etc.) + // behave the same as XSLoader-based modules in PerlOnJava. + return XSLoader.load(args, ctx); } public static RuntimeList boot_DynaLoader(RuntimeArray args, int ctx) { diff --git a/src/main/perl/lib/DynaLoader.pm b/src/main/perl/lib/DynaLoader.pm index b65d46e41..86018865b 100644 --- a/src/main/perl/lib/DynaLoader.pm +++ b/src/main/perl/lib/DynaLoader.pm @@ -21,7 +21,9 @@ BEGIN { *bootstrap = sub { my ($module) = @_; $module = caller() unless defined $module; - die "Can't load module $module\n"; + # Delegate to XSLoader::load for its multi-stage fallback + require XSLoader; + return XSLoader::load($module); }; }