swaroop has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

How to use pod2usage ? I would like to document my script. How to make a man page for the script.

Please help.
Thanks,
Swaroop

Replies are listed 'Best First'.
Re: pod2usage module
by gopalr (Priest) on May 18, 2005 at 07:56 UTC

    Hello,

    Please go through this link POD in 5 minutes.

    I hope it would be helpful.

    Thanks
    Gopal.R

Re: pod2usage module
by eibwen (Friar) on May 18, 2005 at 07:53 UTC

    The pod2usage POD lists the available options and arguments. To create a manpage:

    pod2usage -man -output file.3pl file

    See also Pod::Usage for how to "print a usage message from embedded pod documentation."

Re: pod2usage module
by monkfan (Curate) on May 18, 2005 at 07:55 UTC
    This is the typical usage of Pod::Usage (it's taken from its doc). Is it what you are looking for?
    #!/usr/bin/perl -w use strict; use Getopt::Long; use Pod::Usage; my $man = 0; my $help = 0; ## Parse options and print usage if there is a syntax error, ## or if usage was explicitly requested. GetOptions('help|?' => \$help, man => \$man) or pod2usage(2); pod2usage(1) if $help; pod2usage(-verbose => 2) if $man; ## If no arguments were given, then allow STDIN to be used only ## if it's not connected to a terminal (otherwise print usage) pod2usage("$0: No files given.") if ((@ARGV == 0) && (-t STDIN)); __END__ =head1 NAME sample - Using GetOpt::Long and Pod::Usage =head1 SYNOPSIS sample [options] [file ...] Options: -help brief help message -man full documentation =head1 OPTIONS =over 8 =item B<-help> Print a brief help message and exits. =item B<-man> Prints the manual page and exits. =back =head1 DESCRIPTION B<This program> will read the given input file(s) and do something use +ful with the contents thereof. =cut
    Regards,
    Edward
Re: pod2usage module
by PodMaster (Abbot) on May 18, 2005 at 07:59 UTC
      Thanks guys , but whenever using "man <script name>" its giving the following error message.

      "no mannual entry for script1."

      Is it possible to convert pod document as man page.

      thanks,
      swaroop
        `perldoc pod2man'

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

Re: pod2usage module
by bsdz (Friar) on May 18, 2005 at 09:13 UTC