in reply to Regular expression
If you just want to get the year and month part of the date, try this:
use Date::Manip; my $maxdate = "2006-05-11"; my($m_year, $m_month) = UnixDate($maxdate, "%Y", "%m"); [download]