in reply to print # of lines in window?
For mac users running the script in a Terminal (or X-windows xterm), perldoc will automatically put the POD man page through the default paging program (usually "more" or "less"), and will make it look very polished and professional. Here's a typical template that I use for just about every perl script that I write:
The perlpod man page explains how to put your "man page" documentation into your script. Also, the man page for Getopt::Long (you are using that module, aren't you?) has a section on "Documentation and help texts" which explains how to avoid having to duplicate your synopsis string.#!/usr/bin/perl # fill in paragraphs between the "=head1" lines: =head1 NAME =head1 SYNOPSIS =head1 DESCRIPTION =cut use strict; my $Usage = "$0 "; # fill in synopsis here, as well as above
(Note that my suggested template above requires the synopsis to be in two places -- that's because I haven't memorized that portion of the Getopt::Long man page yet...)
Update: If you are writing a command-line tool, and are intending that the user carry on a keyboard dialog with the script while it is running, I would offer the following suggestions:
If the script needs a lot of input from the user, but all of it is knowable in advance, then you're talking about "input data", which should be read from a file that the user provides (in @ARGV) -- the less keyboarding, the better.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print # of lines in window?
by duckyd (Hermit) on Oct 31, 2006 at 01:41 UTC |