my $maxdate = "2006-06-06"; my ($m_year, $m_month) = unpack 'A4 x A2', $maxdate;