# -*- mode: snippet -*- # name: perlscript # key: perlscript # -- #!/usr/bin/perl # ${1:SCRIPTNAME} ${2:SCRIPTDOESSOMETHING} # and is released under the terms of the GNU GPL version 3, or any # later version, at your option. See the file README and COPYING for # more information. # Copyright `(format-time-string "%Y")` by Don Armstrong . use warnings; use strict; use Getopt::Long; use Pod::Usage; =head1 NAME $1 - $2 =head1 SYNOPSIS $1 [options] Options: --debug, -d debugging level (Default 0) --help, -h display this help --man, -m display manual =head1 OPTIONS =over =item B<--debug, -d> Debug verbosity. (Default 0) =item B<--help, -h> Display brief usage information. =item B<--man, -m> Display this manual. =back =head1 EXAMPLES C<$1> =cut use vars qw($DEBUG); my %options = (debug => 0, help => 0, man => 0, ); GetOptions(\%options, 'debug|d+','help|h|?','man|m'); pod2usage() if $options{help}; pod2usage({verbose=>2}) if $options{man}; $DEBUG = $options{debug}; my @USAGE_ERRORS; if (1) { push @USAGE_ERRORS,"You must pass something"; } pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS; $0 __END__ # Local Variables: # indent-tabs-mode: nil # cperl-indent-level: 4 # End: