kulls has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,
I got the doubt, that Can i write a POD for the .pl file ? Or POD is only applicaple for package file (.pm). If it's applicable only for the .pm files then, Can anynone please suggest me how to provide the documents for .pl file. Basically my .pl file is kind of utility script (having few subroutines) which is used to handle the text files.
Thank you,
- kulls

Replies are listed 'Best First'.
Re: POD for .pl file ?
by McDarren (Abbot) on May 16, 2006 at 14:07 UTC
Re: POD for .pl file ?
by ptum (Priest) on May 16, 2006 at 13:59 UTC

    I'm not sure I understand your question. You can put POD in any Perl code, as long as you use the tags correctly. You might check out the discussion associated with POD Standards for ideas about the extent of your POD.


    No good deed goes unpunished. -- (attributed to) Oscar Wilde
Re: POD for .pl file ?
by blazar (Canon) on May 16, 2006 at 14:04 UTC

    Sure you can. Had you tried, you would have found out yourself. An example in one of my own scripts! Although the POD is quite far from the usual standards (but IMHO suited for that script)...

Re: POD for .pl file ?
by kwaping (Priest) on May 16, 2006 at 15:28 UTC
    I have a feeling you're not having trouble putting the POD into the .pl file, but are confused as to how you are going to read it once it's in there.

    If that's the case, perldoc -F filename.pl will work. (Note that the "F" is capital.)

    ---
    It's all fine and dandy until someone has to look at the code.

      The -F generally isn't even needed. perldoc filename.pl will work just fine.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

        True, as long as the script is in the user's $PATH. perldoc searches $PATH as well as @INC so it can read the POD in the utility scripts that come with perl, including perldoc itself.

Re: POD for .pl file ?
by planetscape (Chancellor) on May 17, 2006 at 10:43 UTC