in reply to getopt::std to pass arguments to command line help
use warnings; use strict; use Getopt::Long qw(GetOptions); my %opt = (logdir => 'foo'); GetOptions(\%opt, qw(logdir=s)) or die; print "logdir=$opt{logdir}\n"; __END__ Run it like: myprog.pl -logdir bar Output: logdir=bar
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getopt::std to pass arguments to command line help
by Discipulus (Canon) on Jan 21, 2015 at 08:19 UTC | |
|
Re^2: getopt::std to pass arguments to command line help
by hextor (Initiate) on Jan 20, 2015 at 21:10 UTC |