根据Pod::Usage 的文档,pod2usage(-verbose => 2)
“打印了整个手册页”。但是,在某些情况下,会显示脚本的 perl 源代码,而不是格式正确的联机帮助页。
这是一个例子:
use Pod::Usage qw(pod2usage);
pod2usage(-verbose => 2);
__END__
=head1 NAME
Minimal example
=head1 SYNOPSIS
This is the synopsys section.
=cut
运行脚本:
$ perl test.perl
You need to install the perl-doc package to use this program.
use Pod::Usage qw(pod2usage);
pod2usage(-verbose => 2);
__END__
=head1 NAME
Minimal example
=head1 SYNOPSIS
This is the synopsys section.
=cut