Subject: | Pod::Simple interprets POD in here docs |
Sure, sure, people shouldn't do this. Unfortunately, I don't have a
shotgun.
Given this perl program:
my $x = <<'END_DOC';
This is a string.
=head1 What is this?
Who knows?
=cut
END_DOC
perl will read the POD-like content as part of the string. So, perl
considers that part of the perl program.
Pod::Simple will read the POD-like content as part of the POD.
In the end, there can be only one (correct interpretation).
--
rjbs
Subject: | pathologopodical.pl |
use strict;
use Fcntl 'SEEK_SET';
my $pos = tell *DATA;
my $str = do { local $/; <DATA> };
seek *DATA, $pos, SEEK_SET;
eval $str;
use Pod::Simple::DumpAsText;
my $parser = Pod::Simple::DumpAsText->new;
$parser->output_fh(*STDOUT);
my $x = $parser->parse_file(*DATA);
__END__
my $x = <<'END_STR';
Foo
=head1
your mom
=cut
Bar
=head1 HI!!
Foo!
=cut
END_STR
print $x;