in reply to Regular expression
Well, you can capture (and assign) multiple parts of your expression in one go. So something like this:
my ($year, $month, $day) = $maxdate =~ m/(\d+)-(\d+)-(\d+)/;
Of course, with your sample you could do the same thing using split, eg:
my ($year, $month, $day) = split /-/, $maxdate;
But if you want something more robust and reliable, that can deal with different date formats - then you should look at one of the Date parsing modules available on CPAN.
Cheers,
Darren :)
|
|---|