My bad. I got it. I had getopts("ds:h"); and not
getopts("d:s:h"); Sorry for posting something so stupid. chad On Thu, 2002-10-10 at 08:16, chad kellerman wrote: > Hi everyone, > Just started a little script I an am not too sure what I am doing > wong. I am just testing my opts to make sure they are what I want. > Trying to maake a script "dummy prooof" > > Here is what I got: > <code> > > use Getopt::Std; > our ($opt_h, $opt_d, $opt_s); > > if ($opt_h) { > print "Usage: $0 -d <dup ip> -s <server to upgrade> -h <help>\n"; > exit; > }elsif (!defined $opt_s || !defined $opt_d) { > print "please specify -s and -d options\n"; > exit; > }elsif ($opt_d =~ /^[a-zA-Z]/) { > print "please use ip address for dup\n"; > exit; > }elsif ($opt_s =~ /^[0-9]/) { > print "please use domain name of server to be upgraded\n"; > exit; > } > > </code> > > I think I am using the wrong function "!defined" but I am unsure > what else I could use. When I run the script the -h options works but > if I specify -s or -d I always get the print statement "please specify > -s and -d options\n". > > Can anyone offer any help with this? > > thanks, > chad > > > -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305
signature.asc
Description: This is a digitally signed message part