On 8/1/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > Jay Savage wrote: > > Strings compare character by character, from left to right, so > > > > 2 = 2
OP asked why this particular date format sorts correctly using string comparison. I wasn't giving example code (you might have noticed the complete lack of any, well, code), I was tying to illustrate how the comparison happens. '2 == 2' is a Perl test for numeric equality, which has nothing to do with string comparisons. '1 = 1', on the other hand, is a statement of fact. > > 1 < 2 > > 10 > 2, '10' lt '2' Huh? First of all, the number in question were 11 and 12. More importantly, there was no discussion of either Perl numbers or Perl string literals (which is where I assume you were going with the quotes), so I have no idea where you're going with this. Again, this wasn't a bit of example code comparing numbers. It is the point in the chain at which the *string* comparison encounters its first inequality, 2007-11-01 is shown to be, stringwise, less than 2007-12-01, and the comparison stops Again, '1 < 2' is a demonstrably true statement, whether we're talking numerics or ASCII or utf-8 code points. I'm not sure what you're taking issue with here. -- j -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!