in reply to Grabbing year and month from filename
Use regular expression and parse the year and month from the file name.
(OR)$filename =~ /^(\d+)-(\d+)-(.*)/; my $year = $1; my $mon = $2; print("$year-$mon");
Use split() method
my $filename = "2010-7-this-is-an.html"; my ($year, $mon) = split('-', $filename); print("$year-$mon");
All is well. I learn by answering your questions...
In Section
Seekers of Perl Wisdom