azool has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -wT use Getopt::Std; use Getopt::Long; GetOptions( "help" => \$help, "file=s" => \$file, "database=s" => \$database, "user=s" => \$user, "password=s" => \$password); #-h ARG, -f ARG, -d ARG, -u ARG, -p ARG sets $args{h},sets $args{f}, s +ets $args{d}, sets $args{u}, sets $args{p} getopts("hf:d:u:p:", \%args); if ($args>=2){ $help=$args{h}; $file=$args{f}; $database=$args{d}; $user=$args{u}; $password=$args{p}; }elsif ($help){ print "rip_sched -h/--help -f/--file datafile -d/--database databa +se -u/--user database-user -p/--password database-password\n"; exit 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getopt?
by tommyw (Hermit) on Oct 25, 2001 at 02:28 UTC | |
by azool (Initiate) on Oct 25, 2001 at 02:57 UTC | |
by tommyw (Hermit) on Oct 25, 2001 at 03:30 UTC | |
by premchai21 (Curate) on Oct 25, 2001 at 05:12 UTC | |
by chipmunk (Parson) on Oct 25, 2001 at 19:15 UTC | |
by azool (Initiate) on Oct 25, 2001 at 22:33 UTC |