Skip to content

fix: restore CPAN regressions (eval return, regex \e, require return value)#851

Merged
fglock merged 2 commits into
masterfrom
fix/cpan-random-regressions-jun2026
Jun 9, 2026
Merged

fix: restore CPAN regressions (eval return, regex \e, require return value)#851
fglock merged 2 commits into
masterfrom
fix/cpan-random-regressions-jun2026

Conversation

@fglock

@fglock fglock commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix return %hash in eval-generated subs by skipping scope cleanup on the return-value register (restores DateTime/Specio stack and Params::ValidationCompiler)
  • Fix Perl regex \e / \a escapes: translate to \x1B / \x07 and exclude from required-literal prefilter (restores Text::ANSI::Util and Text::ANSITable)
  • Fix do/require return values: preserve the last runtime expression and ignore compile-time statements (use/no pragmas via CompilerFlagNode, sub declarations). This restores Text::Patch and similar modules that set our $VERSION = '...' without a trailing 1; — matching Perl 5 (pp_leaveeval truth check), not a $VERSION fallback

Test plan

  • make (unit tests pass)
  • do Text/Patch.pm returns 1.8
  • require Text::Patch succeeds without trailing 1;
  • explicit 0; last statement still fails require
  • jcpan -t Text::Patch — PASS
  • jcpan -t Text::ANSI::Util — PASS
  • jcpan -t Text::ANSITable — PASS
  • jcpan -t DateTime::Format::Mail — PASS
  • jcpan -t DateTime::Format::MySQL — PASS
  • jcpan -t DateTimeX::Web — PASS

fglock and others added 2 commits June 9, 2026 10:21
Fix three unrelated regressions from cpan_random_tester: skip hash/array
cleanup on return registers so eval_closure subs can return %hash;
translate Perl \e/\a escapes and exclude them from required-literal
prefilter; accept require when $Package::VERSION is truthy even if the
.pm file's last statement is not true.

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <cursoragent@cursor.com>
Perl returns the last runtime expression from do FILE, not a $VERSION
fallback. Exclude use/no CompilerFlagNodes and compile-time sub
declarations from block return values so modules like Text::Patch
(our $VERSION before use warnings) return 1.8 correctly.

Replace require_version_fallback.t with require_module_return.t.

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <cursoragent@cursor.com>
@fglock fglock changed the title fix: restore CPAN regressions (eval return, regex \e, require VERSION) fix: restore CPAN regressions (eval return, regex \e, require return value) Jun 9, 2026
@fglock fglock merged commit 07db091 into master Jun 9, 2026
2 checks passed
@fglock fglock deleted the fix/cpan-random-regressions-jun2026 branch June 9, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant