I'm using Perl in Windows and I have written the code in Perl for calling 2 jar files and i want to check if the value returned by any of these 2 jar files is 1.How can i implement this in Perl Code written to call the 2 jars(Sample1 and Sample2) in Perl
my $cmd = "";
my $res = "";
my $cmd1 = "";
my $res1 = "";
$cmd = "java -jar C:/xampp/perl/bin/Sample1.jar";
$res = qx/$cmd/;
print "$res\n";
$cmd1 = "java -jar C:/xampp/perl/bin/Sample2.jar";
$res1 = qx/$cmd1/;
print "$res1\n";
I want to check if any of these two jar files i.e If either of Sample1.jar or Sample2.jar has returned value 1.I'm using return statement in these jar files to return the value but I'm not able to take those values in perl and check if the value returned is 0 or 1 .Can anyone tell me what modifications should be made so that it would work properly.I tried using
if($res==1 || $res1==1)
{
$val =1;
print $val;
}
else
{
$val=0;
print $val;
}
But this didn't work.It's giving me an error Argument "" isn't numeric in numeric eq (==) at Sample1.pl line 30, line 4. Argument "" isn't numeric in numeric eq (==) at Sample2.pl line 34, line 4.