【发布时间】:2019-05-13 07:50:16
【问题描述】:
是否可以将保存在变量中的 pod 代码转换为与 pod2text 一起使用时的行为类似于 $=pod?
#!/usr/bin/env perl6
use v6;
use Pod::To::Text;
my $code = $*PROGRAM.slurp;
my $pod = $code.subst( / ^ .+ \n <?before '=begin pod'> /, '' );
# convert $pod so it works with pod2text like $=pod does
say pod2text $pod;
say "==============";
say pod2text $=pod;
=begin pod
=head1 NAME
Test pod
=head1 DESCRIPTION
This is a test.
=end pod
【问题讨论】:
-
似乎
pod2text需要某种Pod::对象作为输入(而不仅仅是字符串)以便转换为文本,请参阅the source code
标签: raku