|
-
February 25th, 2006, 08:36 PM
#1
simple question
Just start learn Perl..
I try this:
Code:
$in1=<STDIN>;
$in2=<STDIN>;
$x1=$in1==$in2;
print("$x1");
Question:
enter 1 and 1, I got 1;
but enter 1 and 2, I got nothing, suppose to be 0, right?
-
February 26th, 2006, 06:54 AM
#2
Re: simple question
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);
-
February 26th, 2006, 06:07 PM
#3
Re: simple question
 Originally Posted by visualAd
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|