Fix: Sync latest Perl5 modules and restore Data::Dumper numified scalar handling#866
Merged
Merged
Conversation
This commit includes: 1. Sync latest Perl5 modules from perl5/ tree: - Archive::Tar and related modules - IO::Socket::IP updates - NEXT module updates - Pod documentation updates (perldelta, perlclass, etc.) - Test::Builder improvements - vars.pm updates 2. Dependency version updates: - ASM: 9.9.1 -> 9.10.1 - BouncyCastle: 1.78.1 -> 1.84 - Commons Compress: 1.27.1 -> 1.28.0 - JUnit Jupiter: 6.1.0-M1 -> 6.1.1 - SQLite JDBC: 3.51.3.0 -> 3.53.2.0 3. Fix Data::Dumper numified scalar handling: - Created patch Data-Dumper.pm.patch - Adds PerlOnJava-specific check for numified scalars - Fixes test failure in unit/data_dumper_numified.t - Ensures numeric literals and numified strings dump as numbers, not quoted strings - Updated import config to apply patch during sync The Data::Dumper fix restores behavior that was overwritten during the Perl5 sync. The _perlonjava_numified_safe_decimal() method checks if a scalar has been used in numeric context and should be dumped as a number instead of a quoted string, matching Perl5's internal behavior. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR syncs the latest Perl5 modules, updates dependencies, and fixes Data::Dumper's handling of numified scalars to match Perl5's XS behavior.
Changes
1. Perl5 Module Sync
Updated modules to latest versions from perl5/ tree:
2. Dependency Updates
3. Data::Dumper Numeric Scalar Detection
The Problem
The test
unit/data_dumper_numified.twas failing because Data::Dumper was outputting numeric values as quoted strings:Root Cause Analysis:
/^(?:0|-?[1-9][0-9]{0,8})\z/The Solution
1. Improved
RuntimeScalar.isDataDumperNumifiedSafeDecimal():2. Data::Dumper patch (
Data-Dumper.pm.patch):_perlonjava_numified_safe_decimal()before the regexWhy This Approach Works
PerlOnJava has an advantage: we can expose scalar type information (INTEGER, DOUBLE, STRING) that pure Perl Perl5 cannot access. By adding a hook in Data::Dumper's pure Perl code that calls back to our Java type system, we achieve XS-like behavior without needing actual XS code.
This is the correct solution because:
Test Plan
unit/data_dumper_numified.tpasses (all 7 tests)makeint()function marking scalars as numifiedGenerated with
Claude Code