I am calling pod2usage with verbose level 1 when -help is provided (Please run below code on LINUX).
&GetOptions( 'h|help' => \$opt_help, 'man' => sub{ pod2usage({-verbose=>2, -exitval=>0}); }, 'q|quiet' => \$opt_quiet, 'c|config=s' => \@opt_config, 'p|project=s' => \$opt_proj ) || pod2usage(1); if($opt_help){ print "help---------------\n"; pod2usage(1); }

But this is not printing the SYNOPSIS secction from the Pod document. I m using embedded pod document.
please help me! <br
Here is the whole program with POD document.
use strict; use Getopt::Long; use Pod::Usage; my $opt_maxError = 0; my $opt_quiet = 0; my $file = ""; my $errors = 0; my @opt_config; my $opt_project; my $opt_help; my @files = (); &GetOptions( 'h|help' => \$opt_help, 'man' => sub{ &pod2usage({-verbose=>2, -exitval=>0}); }, 'q|quiet' => \$opt_quiet, 'c|config=s' => \@opt_config, 'p|project=s' => \$opt_project ) || pod2usage(1); if($opt_help){ print "help---------------\n"; &pod2usage(1); } if(@ARGV){ @files = @ARGV; } elsif(!@opt_config && !$opt_project){ @files = glob("*.cc *.txt"); } if(!defined $opt_project){ pod2usage( -msg => "\n%E, PROJECT DEFINITION FILE DOESN'T EXIST.\n", -exitval=>1); } # take place for all those specified files if(!@files) { pod2usage( -msg => "\n%E, NO TESTPLAN LISTS FILE.\n", -exitval=>1); } 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.

In reply to pod2usage does not work for verbose level 1. by isha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.