You all might know programs like git, svn or mp4box where you can ask for a general help and specific help like:

svn help commit

I've started today a script which also has several commands like svn has and so I'd like to have a similar way to present help, but I can't figure out how to utilize Pod::Usage for this. I have to add that unfortunately the Pod::Usage version on the target system is at V1.33 :(

Update: My initial idea was to have one POD for each of the commands.

Does anyone have any useful tipps for me?

Update #2 Thanks to dasgar I think I found a way:

I defined a sub to which I pass an option list like pod2usage expects. The option "-pod" defines the name of the pod I want, while the rest is simply passed on to pod2usage.

#!/usr/bin/perl use strict; use warnings; use Pod::Usage; pod( -pod => 'test', -verbose => 2 ); sub pod { my(%options)= @_; my $pod_text; SWITCH: for ($options{-pod}) { /^main$/ && do { $pod_text=<<'POD'; =head1 NAME Main =head1 SYNOPSIS main.pl [options] =head1 DESCRIPTION This is main =cut POD last SWITCH; }; /^test$/ && do { $pod_text=<<'POD'; =head1 NAME Test =head1 SYNOPSIS Test.pl [options] =head1 DESCRIPTION This is Test =cut POD last SWITCH; }; return; } delete $options{-pod}; delete $options{-input}; open my $pod_file, '<', \$pod_text; pod2usage( -input => $pod_file, %options ) }

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

In reply to [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.