In my script, i get the file's creation month in locale's abbreviated month name format ( as 'date +%b' in unix - Jan, Feb and so on);
what's the easiest way to convert it to month's number?
thanks in advnce.
Easiest way's probably just to construct a hash (though there's probably a module that'll do it:
Code:
my %months;
@months{ qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/ } = 1 .. 12;
my $month_name = 'Feb';
my $month_number = $months{ $month_name };
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.