Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

pod2usage not displaying the pod document information for verbose level 0 & 1 on LINUX

by isha (Sexton)
on Jan 30, 2008 at 10:45 UTC ( [id://665096]=perlquestion: print w/replies, xml ) Need Help??

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

Here is the code
#! /hwnet/activestate/perl-5.6/bin/perl -w # This script is used to verify syntax and format use Pod::Usage; use Getopt::Long; &GetOptions( 'help' => \$help, 'man' => \$man) || pod2usage(1); if($man){ pod2usage({-verbose=>2,-exitval=>0}); } if($help){ pod2usage(); exit(0); } print "----------------------------------------------\n"; exit ##############END OF SCRIPT######### __END__ =head1 NAME test.pl -- A simple script. =head1 SYNOPSIS test.pl [options] Options: -h or -help Display help. -man About the script. -c <config_name> Configuration name. -p <path> Path to Project Definition File. -m <n> or -maxerror <n> Maximum number of errors. -q or -quiet Do not print errors. =head1 OPTIONS =over 8 =item B<-h|help> Print a brief help message and exits. =item B<-man> Prints the manual page and exits. =item B<-c> <name> Configuration name. i.e: -c tg,mpg or -c tg -c mpg =item B<-p> <path> Path to Project Definition File. =item B<-m|maxerror> <number> Maximum number of errors. =item B<-q|quiet> Setting this switch will not print any error on stderr. =back =head1 DESCRIPTION The script parses the feature file & print errors.

this doesn't work for
test.pl -help
It works fine with
test.pl -man

Run this script on LINUX
  • Comment on pod2usage not displaying the pod document information for verbose level 0 & 1 on LINUX
  • Download Code

Replies are listed 'Best First'.
Re: pod2usage not working for verbose level 0 & 1 on LINUX
by Erez (Priest) on Jan 30, 2008 at 12:02 UTC
      It's the same question and alas no answer. The problem is that pod2usage is not working for verbose 0 or 1, but it works for 2. I am seeing this problem on Linux RedHat release 4 update 4. I use Pod::Checker and it shows no errors. The complete documentation works but pod2usage does not recognize OPTIONS or SYNOPSIS though verbose level prints the whole thing correctly.
Re: pod2usage not displaying the pod document information for verbose level 0 & 1 on LINUX
by kyle (Abbot) on Jan 30, 2008 at 16:52 UTC

    Running with -h, -help, and --help all give me the synopsis section from the POD. What do you want/expect it to do? What does it do for you instead?

      Hi Kyle,
      When i ru nthe script with
      > test.pl -h
      > test.pl --help
      > test.pl -help

      It is not showing me anything on the prompt. but when i run it with -man it is opening the man page.
      Did u try running this script in Linux?
      Also, when I tried with the -input=>"./help.pm" for help option it is showing me the SYNOPSIS from help.pm file. but without -input=>"./help.pm" (POD in current) it is not working... Is there anything wrong with POD? Please help me...
        Say, after you remove the 5 some spaces on the line after =item B<-p> <path>, does pod2usage() works as expected? That is what podchecker(1) reported anyway (in spite of which "Usage:" is being printed here as expected with perl 5.8.7 (on GUN/Linux)).
Re: pod2usage not working for verbose level 0 & 1 on LINUX
by andreas1234567 (Vicar) on Jan 30, 2008 at 11:18 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://665096]
Approved by andreas1234567
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found