Summary
PerlOnJava's bundled Pod::Simple reports incorrect source line positions for multi-line POD blocks. This causes Pod::Strip v1.100 to emit too few replacement comments when replace_with_comments is enabled.
CPAN evidence
- CPAN run:
20260918-141920-96054
- Distribution:
Pod::Strip v1.100
- System Perl: PASS — 3 files, 7 tests
- PerlOnJava: FAIL — 1/3 test programs, 1/7 reported subtests
- Both JVM and interpreter backends reproduce the failure
The failing test is t/11_replace_with_comments.t. It parses source containing two multi-line POD blocks and expects one # stripped POD comment for each source line removed from the output.
PerlOnJava emits one replacement comment for each POD block. The expected output contains seven comments for the first block and five for the second, while the actual output contains only one for each block.
Root cause
Pod::Strip installs a Pod::Simple code_handler that receives the next source-code line number as its second argument. It uses that line number to emit the appropriate number of # stripped POD lines:
if ($code_line + 1 < $next_code_line) {
print "# stripped POD\n" x ($next_code_line - $code_line - 1);
}
Under PerlOnJava, the callback line positions do not account for all lines in the removed POD block. The callback therefore believes that the next code line is immediately after the previous code line and emits only one marker per POD section.
This is a Pod::Simple source-position compatibility problem, not a defect in Pod::Strip.
Reproduction
Run the Pod::Strip v1.100 test suite under PerlOnJava. t/00-compile.t and t/10_strip.t pass, while t/11_replace_with_comments.t fails its pod stripped comparison.
A minimal reproducer should parse code containing a multi-line POD block through Pod::Simple with a code_handler, then verify that the callback’s reported line number includes every source line consumed by the POD block.
Expected behavior
For a POD block spanning multiple source lines, Pod::Simple must report the correct next code line to code_handler, matching standard Perl. Consumers that preserve line numbering should then be able to emit one placeholder line per removed source line.
Requested fix
- Correct
Pod::Simple line accounting for multi-line POD sections in parse_string_document and related parsing paths.
- Preserve accurate callback positions across consecutive POD blocks, blank lines, and transitions between POD and code.
- Add focused project-owned tests for
code_handler line positions and replacement-line counts.
- Rerun
Pod::Strip v1.100 on both JVM and interpreter backends.
Summary
PerlOnJava's bundled
Pod::Simplereports incorrect source line positions for multi-line POD blocks. This causesPod::Stripv1.100 to emit too few replacement comments whenreplace_with_commentsis enabled.CPAN evidence
20260918-141920-96054Pod::Stripv1.100The failing test is
t/11_replace_with_comments.t. It parses source containing two multi-line POD blocks and expects one# stripped PODcomment for each source line removed from the output.PerlOnJava emits one replacement comment for each POD block. The expected output contains seven comments for the first block and five for the second, while the actual output contains only one for each block.
Root cause
Pod::Stripinstalls aPod::Simplecode_handlerthat receives the next source-code line number as its second argument. It uses that line number to emit the appropriate number of# stripped PODlines:Under PerlOnJava, the callback line positions do not account for all lines in the removed POD block. The callback therefore believes that the next code line is immediately after the previous code line and emits only one marker per POD section.
This is a
Pod::Simplesource-position compatibility problem, not a defect inPod::Strip.Reproduction
Run the
Pod::Stripv1.100 test suite under PerlOnJava.t/00-compile.tandt/10_strip.tpass, whilet/11_replace_with_comments.tfails itspod strippedcomparison.A minimal reproducer should parse code containing a multi-line POD block through
Pod::Simplewith acode_handler, then verify that the callback’s reported line number includes every source line consumed by the POD block.Expected behavior
For a POD block spanning multiple source lines,
Pod::Simplemust report the correct next code line tocode_handler, matching standard Perl. Consumers that preserve line numbering should then be able to emit one placeholder line per removed source line.Requested fix
Pod::Simpleline accounting for multi-line POD sections inparse_string_documentand related parsing paths.code_handlerline positions and replacement-line counts.Pod::Stripv1.100 on both JVM and interpreter backends.