> 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] |
I did take a look at POD::Usage, but apparently I did not look hard enough.
Thank you, Hofmator, for pointing out my ignorance!
I converted the example script into an executable, ran it and what do you know...it worked.
Thanks again to both of you.
BTW, is that the way most of you do it?
Greetings
May Larry be with you!
| [reply] |
I've been fiddling about with POD::Usage again and I have noticed that this approach only seems to work if the original perl script is in the same directory as the executable. POD::Usage keeps looking for the original .pl file which can't be found.
Anybody know of a way to remedy this?
UPDATE
I just read in the documentation that you can set the path to the pod input file, but I still think that's mighty inconvenient.
I'm afraid there's no other way though, right?
sigh
Thanks!
May Larry be with you
| [reply] |