V
Vahid Moghaddasi
Hi all,
I need some help to change my perl script to accept more of the same
command line option, for example: myscript.pl -s server1 -s server2 -s
server3 OR myscript.pl -s server1 server2 server3 etc..
The following will only accept one option.
....
while ( $_ = $ARGV[0]) {
shift;
if (/^-s/) { $servername = &getoptions("-server");
}
elsif (/^-u/) { $username =
&getoptions("-username"); }
and so on ...
}
sub getoptions {
$result = $ARGV[0];
shift @ARGV;
return $result;
}
Thanks for your help,
Vahid.
I need some help to change my perl script to accept more of the same
command line option, for example: myscript.pl -s server1 -s server2 -s
server3 OR myscript.pl -s server1 server2 server3 etc..
The following will only accept one option.
....
while ( $_ = $ARGV[0]) {
shift;
if (/^-s/) { $servername = &getoptions("-server");
}
elsif (/^-u/) { $username =
&getoptions("-username"); }
and so on ...
}
sub getoptions {
$result = $ARGV[0];
shift @ARGV;
return $result;
}
Thanks for your help,
Vahid.