>> I just ran into this today, and have no clue what's going on: >> >> % perl -e 'print 10-5.5, "\n"' >> 4.5 >> % perl -e 'print 10-05.5, "\n"' >> 55 >> >> How does 10 minus 5.5 equal 55? Obviously it's the leading zero, but I >> can't think of any reason why it should do that... > > It seems that 05 is taken as octal (leading zero literals are octal), > and there not being an 'octal' point supported, '.' is takee as a concat. so : > > decimal 10 - octal 5( which is decimal 5 also ) = 5 conat 5 => 55 > > Aloha => Beau; > [EMAIL PROTECTED] > 2005-12-03
Wow, thanks, Beau. That's scary, I never considered that as something that could happen. I wonder if I've ever mis-processed data with a leading zero and gotten the wrong answer... Yikes. - Bryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>