#! /usr/bin/perl -w

# Set the environment variables AUTHOR (e.g., Bill Wohler) and ORGANIZATION
# (e.g., Newt Software) before running this script.

my $VERSION = '$Revision: 6393 $';
($year) = (localtime)[5]+1900;
my $organization = $ENV{ORGANIZATION};
my $author = $ENV{AUTHOR};
my $author_quote_at;

unless (defined($organization)) {
    die("The ORGANIZATION environment variable must be set.\n");
}
unless (defined($author)) {
    die("The AUTHOR environment variable must be set.\n");
}

($author_quote_at = $author) =~ s/@/\\@/;

print <<EOTEMPLATE;
#!/usr/bin/perl -w
#
# \$Id\$

=head1 NAME

[PROGRAM-NAME] - [SHORT ONE-LINE DESCRIPTION]

=head1 SYNOPSIS

[CODE FRAGMENT]

=head1 DESCRIPTION

[DESCRIPTION]

=head2 A Sample Subsection

=head2 Yet Another Sample Subsection

=head1 OPTIONS

=over 4

=item --debug

Turn on debugging messages.

=item --help

Display the usage of this command.

=item --version

Display program version.

=back

=head1 RETURN VALUE

[DESCRIPTION]

=head1 EXAMPLES

=over 0

=item [command line]

[DESCRIPTION]

=back

=head1 ENVIRONMENT

=over 0

=item [VARIABLE]

[DESCRIPTION]

=back

=head1 FILES

=over 0

=item [FILE]

[DESCRIPTION]

=back

=head1 SEE ALSO

POD (Plain Old Documentation) documentation:
http://www.perldoc.com/perl5.6/pod/perlpod.html

Example of a manual page:
http://www.perldoc.com/perl5.6/bin/pod2man.html

=head1 VERSION

\$Revision\$

=head1 AUTHOR

$author

Copyright (c) $year $organization. All rights reserved.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, you can find it at
http://www.gnu.org/copyleft/gpl.html or write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

=head1 METHODS

=cut

# Initializations.
BEGIN {
}

# Packages and pragmas.
use Getopt::Long;

use strict;

# Constants.
my \$cmd;                                # name by which command called
(\$cmd = \$0) =~ s|^\\./||;                # ...minus the leading ./
my \$ver = \'$VERSION\';		# program version with CVS noise
\$ver =~ s/\\\$//g;                        # strip dollar signs
\$ver =~ s/Revision://;                  # strip CVS keyword
\$ver =~ s/\\s//g;                        # strip whitespace

# Variables (may be overridden by arguments).
my \$debug = 0;				# verbose mode
my \$help = 0;				# display usage
my \$version = 0;			# display version

# Parse command line.
my \%opts;
GetOptions('debug'		=> \\\$debug,
	   'help'		=> \\\$help,
	   'version'		=> \\\$version,
	  ) or usage();

show_version() if (\$version);
usage() if (\$help);

#[CODE, IN SCRIPTS]



=head2 usage

Display usage information and exit.

=cut

sub usage {
    print <<EOF;
Usage: \$cmd [options]
--debug			print actions that program takes
--help			display this message
--version		display program version
EOF
    exit(1);
}

=head2 show_version

Display version information and exit.

=cut

sub show_version {
    print("\$cmd version \$ver\\n".
          "Copyright (c) $year $author_quote_at\\n\\n".
          "\$cmd comes with ABSOLUTELY NO WARRANTY.\\n\\n".
          "This is free software, and you are welcome\\n".
          "to redistribute it under certain conditions.\\n\\n".
          "See `http://www.gnu.org/copyleft/gpl.html' for details.\\n");
    exit(0);
}

=head2 new

Construct a new object.

=over 4

=item Parameters

=over 4

=item [ATTRIBUTE]

[DESCRIPTION]

=back

=item Returns

A reference to the new object.

=back

=cut

sub new {
    my \$class = shift;
    my \$self = {
		'attribute'	=> undef,   # short description for attribute
		'_variable'	=> undef,   # private instance variable
	       };
    bless(\$self, \$class);

    return \$self;
}

=head2 attribute

Get or set [ATTRIBUTE] attribute.

=over 4

=item Parameters

=over 4

=item [ATTRIBUTE]

[DESCRIPTION]

=back

=item Returns

The value of the [ATTRIBUTE] attribute.

=back

=cut

sub attribute {
    my \$self = shift;

    \@_ ? \$self->{attribute} = shift : \$self->{attribute};
}

1;

EOTEMPLATE

