Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!bloom-beacon!ccount From: ccount@athena.mit.edu (Craig A Counterman) Newsgroups: comp.lang.perl Subject: Does it have to be like this? Summary: backwards compatability is a pain Keywords: octal Message-ID: <1990Oct12.060936.7501@athena.mit.edu> Date: 12 Oct 90 06:09:36 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: Massachusetts Institute of Technology Lines: 29 010 < 10. I can deal. 010.0 > 10. This bugs me. (Patchlevel 28) I know what's happening, I hope it can be changed. It's just too obscure. The annoying thing is that I discovered this when discussing a C compiler's annoying failure to deal with '-08.123'. I wanted to show him how a _good_ language would handle it. Oh boy. Oh, and: $x = 010.; is a syntax error. just so you know, Craig PS: To explain for the the confused: a leading 0 on an integer indicates that the number is in octal, e.g. '077'. When perl 3.0/28 sees '010', it's taken to be 8 so (010 < 10). Ok, so far so bad. But (correct me if I'm wrong, Larry) 010.0 is parsed as the numbers 8 and 0, with the '.' indicating a string concatenation, so 010.0 is 80 and (010.0 > 10). Now, as an exercise, explain why 010.0 - 010.0000 == 720 Oh boy.