jeevs wrote:
Before reading the above comments I used the localtime function of
Time::Local to convert the dates into epochs and then comparing
numerically.
But thanks as i was not knowing that the strings i.e 2007-12-01 and
2007-12-02 can be compared using the string operators for dates. Can
anyone point me to how strings are compared. To be more ellaborate i
can understand if strings like 2007-12-01 is less than 2007-12-02 but
how can a string 2007-11-01 will be less than 2007-12-01 .
Strings are compared from left to right. The string "abc" is less than "bac" since the first
letter is the only one compared. So the string "2007-11-30" is less than "2007-12-01" since the
comparison is done only up to the first character that's different.
See `perldoc perlop` for more details.
--
Just my 0.00000002 million dollars worth,
Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/