Parser rejects valid heredoc END statement under strict subs
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
Research direction
Start with the failing t/Tools_Error.t case and reproduce the construct under both the JVM and interpreter backends. Trace how the parser/compiler handles a single-quoted heredoc followed by bareword END under strict subs, then add the suggested focused regression test and confirm the full affected test passes on both backends.
Written by the indexing model from the issue text.
Description
Summary
PerlOnJava rejects valid Perl heredoc syntax in Test-Mockify 1.3. The upstream test suite passes the affected test under system Perl, but PerlOnJava rejects the bareword END after the heredoc terminator while strict subs is enabled.
Reproduction
CPAN compatibility run: 20260916-111623-23683
Distribution: Test-Mockify 1.3
Failing test: t/Tools_Error.t
The relevant source pattern is:
return <<'END_REGEX';
...
END_REGEX
END;
The final END; is accepted by standard Perl, but PerlOnJava reports:
Bareword "END" not allowed while "strict subs" is in use
The CPAN run executed 24 test files and 405 tests. All other test files passed; t/Tools_Error.t aborted during compilation with no subtests run.
Comparison
- System Perl:
t/Tools_Error.tpasses, 4/4 tests. - PerlOnJava JVM backend: fails at
t/Tools_Error.tline 84. - PerlOnJava interpreter backend: fails on the same construct, with the diagnostic pointing at line 75 due to backend-specific source accounting.
This is reproducible without modifying the distribution and affects both execution backends, indicating a shared parser/compiler incompatibility rather than a runtime or dependency issue.
Expected behavior
The test should compile and pass as it does under standard Perl. The END; statement following the END_REGEX heredoc should not be diagnosed as an invalid strict-subs bareword.
Suggested regression coverage
Add a focused project-owned unit test covering a single-quoted heredoc followed by a bareword END; under use strict, and require it to pass on both the JVM and interpreter backends.
Investigation notes
The archived record is FAIL Test::Mockify Test::Mockify::CompatibilityTools, with 405 tests recorded and no dependency/build failure. A duplicate search for Test-Mockify and Bareword END strict subs found no existing matching issue.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 25m
- Merged PRs (30d)
- 157
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:cpan-port bug
Difficulty 4/5 3-5 days Newbie friendliness 44/100
fglock/PerlOnJava#1459 ·
-
area:cpan-port bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
fglock/PerlOnJava#1457 ·
-
bug high-impact
Difficulty 3/5 1-2 days Newbie friendliness 67/100
fglock/PerlOnJava#1456 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 72/100
fglock/PerlOnJava#1455 ·
All issues in fglock/PerlOnJava
Similar issues
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100