my $filename = "2010-7-this-is-an.html"; my ($year, $mon) = split('-', $filename); print("$year-$mon");