V
vabby
Hi
I have to pass certain parameters to a perl program like if log file is
required or not, wot process is to be setup and the mode. I ahve
written the following script, named bat.pl
use Getopt::Std;
use vars qw($opt_p $opt_m $opt_l);
getopts("p:m:l");
my $process = uc($opt_p) || usage();
my $mode = uc($opt_m) || usage();
my $logging = uc($opt_l) ;
print "\n the value of process is $process\n";
print "\n the value of mode is $mode\n";
print "\n the value of log is $logging\n";
exit(1);
so i invoke the program this way
bat -p Ipc -m qa -l N
my problem is that, whatever the value of the 3rd parameter I pass,
the $logging variable gets the value of 1. This is again true if a
reduce the number of variables to be passed to 2 , then the last
variable again gets the value of 1, irrespective of whatever I pass.
tx
vabby
I have to pass certain parameters to a perl program like if log file is
required or not, wot process is to be setup and the mode. I ahve
written the following script, named bat.pl
use Getopt::Std;
use vars qw($opt_p $opt_m $opt_l);
getopts("p:m:l");
my $process = uc($opt_p) || usage();
my $mode = uc($opt_m) || usage();
my $logging = uc($opt_l) ;
print "\n the value of process is $process\n";
print "\n the value of mode is $mode\n";
print "\n the value of log is $logging\n";
exit(1);
so i invoke the program this way
bat -p Ipc -m qa -l N
my problem is that, whatever the value of the 3rd parameter I pass,
the $logging variable gets the value of 1. This is again true if a
reduce the number of variables to be passed to 2 , then the last
variable again gets the value of 1, irrespective of whatever I pass.
tx
vabby