Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/perl5Public

POD section unexpectedly stops at =cut2 (or =cute in string eval) #22759

Closed
@mauke

Description

@mauke

Description
The perl parser is supposed to skip over embedded POD sections. The end of a POD section is marked by a=cut command. However, not every line that starts with=cut is a=cut command. For example:=cute,=cut2,=cut_dry.

The perl parser does not correctly recognize these and, in the case of=cute, behaves differently depending on whether we are in string eval or not.

Steps to Reproduce

use strict;use warnings;print"1..9\n";my$test = 1;my$foo;$foo ="";=pod=cute$foo = "not ";=pod=cutprint$foo,"ok$test - =cute does not end POD\n";$test++;$foo ="";=pod=cut2$foo = "not ";=pod=cutprint$foo,"ok$test - =cut2 does not end POD\n";$test++;$foo ="";=pod=cut_$foo = "not ";=pod=cutprint$foo,"ok$test - =cut_ does not end POD\n";$test++;$foo ="not";=pod=cut$cene$foo ="";=pod=cutprint$foo,"ok$test - =cut\$cene ends POD\n";$test++;# Same as above, but in string eval.evalq{$foo = "";=pod=cute$foo = "not ";=pod=cutprint $foo, "ok $test - =cute does not end POD\n";$test++;$foo = "";=pod=cut2$foo = "not ";=pod=cutprint $foo, "ok $test - =cut2 does not end POD\n";$test++;$foo = "";=pod=cut_$foo = "not ";=pod=cutprint $foo, "ok $test - =cut_ does not end POD\n";$test++;$foo = "not ";=pod=cut$cene$foo = "";=pod=cutprint $foo, "ok $test - =cut\$cene ends POD\n";$test++;};print$@eq"" ?"" :"not","ok$test - did not throw an error\n#$@\n";__END__

Output:

1..9ok 1 - =cute does not end PODnot ok 2 - =cut2 does not end PODnot ok 3 - =cut_ does not end PODok 4 - =cut$cene ends PODnot ok 5 - =cute does not end PODnot ok 6 - =cut2 does not end PODnot ok 7 - =cut_ does not end PODok 8 - =cut$cene ends PODok 9 - did not throw an error#

Expected behavior

1..9ok 1 - =cute does not end PODok 2 - =cut2 does not end PODok 3 - =cut_ does not end PODok 4 - =cut$cene ends PODok 5 - =cute does not end PODok 6 - =cut2 does not end PODok 7 - =cut_ does not end PODok 8 - =cut$cene ends PODok 9 - did not throw an error#

Perl configuration

This is with v5.40.0, but it should affect all perl versions (except before 5.8.9 the=cute test will probably fail without eval, too).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp