According to the documentation of Pod::Usage, with pod2usage(-verbose => 2)
"the entire manpage is printed". However, in some cases, the perl source code for the script is displayed instead of the properly formatted manpage.
Here's an example:
use Pod::Usage qw(pod2usage);
pod2usage(-verbose => 2);
__END__
=head1 NAME
Minimal example
=head1 SYNOPSIS
This is the synopsys section.
=cut
Running the script:
$ 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