From 15d9ebe98d9b78279d1f7e2fdd9b773f482b0088 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 26 Mar 2015 10:12:04 +0100 Subject: [PATCH] templates/TEMPLATE.pl.tpl: use hash for GetOpt::Long params. Signed-off-by: Andreas Gerler --- templates/TEMPLATE.pl.tpl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/templates/TEMPLATE.pl.tpl b/templates/TEMPLATE.pl.tpl index eb2dacce..b67f711a 100644 --- a/templates/TEMPLATE.pl.tpl +++ b/templates/TEMPLATE.pl.tpl @@ -4,6 +4,8 @@ use warnings; use Getopt::Long; use Pod::Usage; +my %params; + =head1 NAME (>>>FILE<<<) - @@ -14,6 +16,8 @@ use Pod::Usage; =head1 SYNOPSIS +=head1 EXAMPLES + =head1 SUBS =head2 main @@ -21,17 +25,16 @@ use Pod::Usage; =cut sub main { - my ( $help, $man, $verbose ); my $result = GetOptions ( - "help|h" => \$help, - "verbose|v" => \$verbose, - "man|m" => \$man - ); + "help|h" => \$params{help}, + "verbose|v" => \$params{verbose}, + "man|m" => \$params{man} + ); - if ( $man ) { pod2usage( -verbose => 2 ); } + if ( $params{man} ) { pod2usage( -verbose => 2 ); } - if ( ! ( $server ) || $help ) + if ( ! ( $server ) || $params{help} ) { pod2usage(1); } -- 2.47.3