Subject: | Pod::Usage( -verbose => 1 ) producing no output |
Date: | Wed, 06 Aug 2008 22:37:33 +1000 |
To: | bug-Pod-Parser [...] rt.cpan.org |
From: | Paul Matthews <plm [...] netspace.net.au> |
The machine in question is OpenSuSE 10.3 running perl 5.8.8. The version
of Pod::Usage is 1.33. The same happens at work on our (newish) Solaris
machines. The program below works fine if given the option --manual, it
prints the manual page. It produces to expected output if given an
illegal option (say --foo). But when asked for --help it produces no
output at all !
I've run out of clues. Help please.
plm@thunk:~/work/prj/bin> ./podme --foo
Unknown option: foo
Usage:
program ( --help | -- manual )
plm@thunk:~/work/xde/bin> ./podme --help
plm@thunk:~/work/xde/bin> cat ./podme
#!/usr/bin/perl -w
use Getopt::Long;
use Pod::Usage;
use strict;
my $help;
my $manual;
GetOptions( 'help' => \$help,
'manual' => \$manual ) || pod2usage(2);
pod2usage( -verbose => 1 ) if( $help );
pod2usage( -verbose => 2 ) if( $manual );
print STDERR "Impossible!\n";
exit(2);
=head1 NAME
program - a program
=head1 SYNOPSIS
program ( --help | -- manual )
=head1 DESCRIPTION
Prints either short help, or long help.
=head1 OPTIONS
=over
=item B<--help>
Print a brief help message and exits.
=item B<--manual>
Prints the manual page and exits.
=back
=cut