On 2004-03-30 21:35:21 -0700, Bryan Harris wrote: > > > > On Mon, 29 Mar 2004 00:38:50 -0700 > > Bryan Harris <[EMAIL PROTECTED]> wrote: > > > >>> Alternatively, you can use the '-t' operator: > >>> > >>> exit 0 if -t STDIN > >> > >> > >> I've been waiting for this for a LONG time, thanks Smoot. > > > > No problem. It took me a while to find the correct operator as well. > > > > Please keep in mind that doing this breaks the de facto Unix standard > > for filters. A simply command which is a filter (e.g takes > > input from STDIN and sends output to STDOUT) is written without any > > consideration whether the input is a terminal, pipe, socket or > > otherwise. This makes it very simple to use the command in a pipeline or > > standalone from the terminal. > > [stuff cut out] > > Smoot, > > Strangely, I find that we almost always want our scripts to act this way. > If any files or data is passed to the script, then it uses it. Otherwise, > it prints usage instructions (since we'd rather not have man pages for > scripts, and I don't know how to build them anyway).
Use POD. See 'perldoc perlpod' for all the details. Then the user can just run 'perldoc scriptname' (provided 'scriptname' is in $PATH) and get a nicely formatted manpage. Have a nice day Morten -- http://m.mongers.org/ -- http://zentience.mongers.org/ __END__ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>