Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- how does perl treat read-in numbers?
December 8, 2008, 2:04 pm
rate this thread
Re: how does perl treat read-in numbers?
All "read-in" data are strings.
If you post a short and complete program that we can run, then we can
solve your problem. If you don't, we can't.
Have you seen the Posting Guidelines that are posted here frequently?
That cannot be it, because the condition is false even if both operands
are strings, because "1" is not greater than "3".
None of the statements below make any output...
print "true\n" if 1 > 37031;
print "true\n" if '1' > '37031';
print "true\n" if 1 gt 37031;
print "true\n" if '1' gt '37031';
By examining the operator that is being used.
">" treats its operands as numbers.
"gt" treats its operands as strings.
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"