You should be able to use options (--help) and/or a combination of Getopt and POD::Usage to provide documentation. | [reply] |
> You should be able to use options (--help) and/or a combination of Getopt and POD::Usage to provide documentation.
Thanks for the tip, joefission. Indeed, I have used options (Getopt::Long) before, but not in combination with Pod::Usage.
What I do now is: if there's an option or a lack of arguments, I run a sub usage() that prints or dies up to a certain terminating string, e.g. EOT.
What I'm missing, though, is the ability to markup your documentation, like you can with POD.
Any other ideas?
Thanks
May Larry be with you
my $name = Perl::scribe->new();
| [reply] [d/l] [select] |
Did you really take a close look at POD::Usage as suggested by joefission?? I think this module does what you want, namely extract (part of) the pod of your script and print it out. This can be used instead of a usage sub. Take especially a look at the example at the end of the documentation - I think that does exactly what you were looking for.
Please correct me if I misunderstood what you are trying to do ...
-- Hofmator
| [reply] |
Heh. People who do not have or are unfamiliar with perl also will not have or will not be familiar with perldoc. If you want to go this route, you could use perldoc or some other POD parser to grab the documentation from your script, format it, and save it to a file, which you can distribute with the executable. | [reply] |