I've done *something* like that by using Getopt::Long and Pod::Usage. Basically, when '--help' is specified with other key command line switches, the user gets the appropriate POD section. Otherwise, they can use '--man' to get the full monty.

use strict; use warnings; use Getopt::Long qw(:config no_ignore_case); use Pod::Usage; my %opt; my ( $opt_help, $opt_man, $opt_versions ); GetOptions( [...] 'P|password=s' => \$opt{Pass}, [...] 's|snmp=s' => \$opt{snmp}, [...] 'username=s' => \$opt{user}, [...] 'help!' => \$opt_help, 'man!' => \$opt_man, 'versions!' => \$opt_versions ) or pod2usage( -verbose => 0 ); if ( defined $opt_help ) { pod2usage( -verbose => 99, -sections => "OPTIONS/PASSWORD MODE" ) if defined $opt{Pass}; pod2usage( -verbose => 99, -sections => "OPTIONS/SNMP MODE" ) if defined $opt{snmp}; pod2usage( -verbose => 99, -sections => "OPTIONS/TELNET SSH MODE" +) if ( defined $opt{user} or defined $opt{pass} ); } pod2usage( -verbose => 1 ) if defined $opt_help; pod2usage( -verbose => 2 ) if defined $opt_man; [...] __END__ =head1 NAME [...] =head1 SYNOPSIS [...] =head1 DESCRIPTION [...] =head1 OPTIONS [...] =head2 PASSWORD MODE To activate B<Password Mode>, use the -P option. [...] =head2 SNMP MODE To activate B<SNMP Mode>, use the -s option. [...] =head2 TELNET SSH MODE To activate B<Telnet Mode>, use the -p option without -s. [...] =cut

In reply to Re: Pod::Usage - Can I have multiple Pods in one script? by VinsWorldcom
in thread [Solved] Pod::Usage - Can I have multiple Pods in one script? by Skeeve

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.