in reply to Date Comparison..?

I'm not exactly sure how you have got your dates stored, but if you have them as individual numbers rather than a combined string or in Gregorian day-format, then it may be worthwhile to have a look at Date::Calc. This module provides a many routines for date manipulation and comparison.

And from the recipes section of the documentation ...

1) How do I compare two dates? Solution #1: use Date::Calc qw( Date_to_Days ); if (Date_to_Days($year1,$month1,$day1) < Date_to_Days($year2,$month2,$day2)) if (Date_to_Days($year1,$month1,$day1) <= Date_to_Days($year2,$month2,$day2)) if (Date_to_Days($year1,$month1,$day1) > Date_to_Days($year2,$month2,$day2)) if (Date_to_Days($year1,$month1,$day1) >= Date_to_Days($year2,$month2,$day2)) if (Date_to_Days($year1,$month1,$day1) == Date_to_Days($year2,$month2,$day2)) if (Date_to_Days($year1,$month1,$day1) != Date_to_Days($year2,$month2,$day2)) $cmp = (Date_to_Days($year1,$month1,$day1) <=> Date_to_Days($year2,$month2,$day2)); Solution #2: use Date::Calc qw( Delta_Days ); if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) > 0) if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) >= 0) if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) < 0) if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) <= 0) if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) == 0) if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) != 0)

 

This module is definitely worth spending some time investigating and experimenting with.

 

Ooohhh, Rob no beer function well without!