Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Documenting executables

by perl::scribe (Sexton)
on Aug 17, 2001 at 18:02 UTC ( [id://105672]=note: print w/replies, xml ) Need Help??


in reply to Re: Documenting executables
in thread Documenting executables

> 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();

Replies are listed 'Best First'.
Re3: Documenting executables
by Hofmator (Curate) on Aug 17, 2001 at 18:26 UTC

    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

      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!
      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://105672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-16 19:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found