Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod below __END__ not parsed if __DATA__ section is present #16

Open
mkrull opened this issue Dec 27, 2013 · 2 comments
Open

Pod below __END__ not parsed if __DATA__ section is present #16

mkrull opened this issue Dec 27, 2013 · 2 comments

Comments

@mkrull
Copy link

mkrull commented Dec 27, 2013

Pod below __END__ is not recognized if a __DATA__ section is present.
See #15 for additional info.

use strict;
use warnings;
use feature 'say';
use PPI::Document;

=head1 Test
This is a piece of POD.
=head2 Sub
This is also a piece of POD.
=cut

my $content = '';
{
    local $/;
    open my $fh, '<', $0;
    $content = <$fh>;
    close $0;
}

my $doc = PPI::Document->new(\$content);
my $pod .= PPI::Token::Pod->merge(@{$doc->find('PPI::Token::Pod')});
say $pod;

__DATA__
# some data here
__END__

=head1 More
This should also be a piece of POD. Should it?
=cut

This test script yields:

=pod

=head1 Test
This is a piece of POD.
=head2 Sub
This is also a piece of POD.

=cut

Expected output:

=pod

=head1 Test
This is a piece of POD.
=head2 Sub
This is also a piece of POD.

=head1 More
This should also be a piece of POD. Should it?

=cut
@wchristian
Copy link
Member

Thanks a bunch, this is complete enough to make a test and implementation from it. :)

@karenetheridge
Copy link
Contributor

Confirmed - I noticed this when moving things around in Acme::CPANAuthors::Nonhuman and PodWeaver stopped being able to find any pod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants