Just start learn Perl..
I try this:
Question:Code:$in1=<STDIN>;
$in2=<STDIN>;
$x1=$in1==$in2;
print("$x1");
enter 1 and 1, I got 1;
but enter 1 and 2, I got nothing, suppose to be 0, right?
Printable View
Just start learn Perl..
I try this:
Question:Code:$in1=<STDIN>;
$in2=<STDIN>;
$x1=$in1==$in2;
print("$x1");
enter 1 and 1, I got 1;
but enter 1 and 2, I got nothing, suppose to be 0, right?
The value it holds is actually false. False can also be represented by a null string. Convert it to an integer and you'll see 0:
$x1 = (integer) ($in1 == $in2);
Thank you!Quote:
Originally Posted by visualAd