我正在使用PPI来对Perl文件进行标记。但是,heredoc似乎没有正确标记。我正在使用以下代码对文件进行标记:
while True:
result = func()
if not (results.append(result)):
break
以下是被标记化的perl文件:
my $file_name = shift @ARGV;
use PPI;
use PPI::Dumper;
my $Document = PPI::Document->new($file_name);
my $Dumper = PPI::Dumper->new($Document);
$Dumper->print;
__END__
我得到以下输出:
my $name = 'Foo';
my $message = <<'END_MESSAGE';
Dear $name,this is a message I plan to send to you.
regards
the Perl Maven
END_MESSAGE
print $message;
有什么办法可以获取整个Heredoc的值吗?