DanDan has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, DanDan Thanks for all your great help... The solutions and ideas and pointers are spot on. Thanks, DanDan.... cut ... my $str_arg = join " ",@ARGV; #remove spaces $str_arg =~ s/\s//g; @args= split /-/, $str_arg; shift @args; for my $arg (@args) { my $opt = substr($arg,0,1); switch ($opt) { case /d/ { #this is taking the value off. $options{$opt}=$arg; print "This is a database $options{$opt}\n"; } case /i/ { $options{$opt}=$arg; print "This is an instance $options{$opt}\n"; } else { print "Error arg not recognised!!!\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Command Prompt arguments.
by slife (Scribe) on Jun 21, 2004 at 11:50 UTC | |
by hmerrill (Friar) on Jun 21, 2004 at 12:34 UTC | |
by slife (Scribe) on Jun 21, 2004 at 12:54 UTC | |
|
Re: Command Prompt arguments.
by borisz (Canon) on Jun 21, 2004 at 10:54 UTC | |
|
Re: Command Prompt arguments.
by eserte (Deacon) on Jun 21, 2004 at 10:56 UTC | |
|
Re: Command Prompt arguments.
by husker (Chaplain) on Jun 21, 2004 at 15:18 UTC |