M
Me
I need to get the past 5(x) months for certaing calculations. What I
have is listed below:
########################################
my $year, $month_str, $month_int;
foreach my $count (1..5) {
$year = `date --date '$count months ago' +"%Y"`;
chop($year);
$month_str =`date --date '$count months ago' +"%b"`;
chop($month_str);
$month_int =`date --date '$count months ago' +"%m"`;
chop($month_int);
print "\n $year:$month_str:$month_int";
}
########################################
This works as expected, the problem is I am using a shell command and I
would like to move away from it. Is the perl module that is able to take
parameters juat like the 'date' command?
have is listed below:
########################################
my $year, $month_str, $month_int;
foreach my $count (1..5) {
$year = `date --date '$count months ago' +"%Y"`;
chop($year);
$month_str =`date --date '$count months ago' +"%b"`;
chop($month_str);
$month_int =`date --date '$count months ago' +"%m"`;
chop($month_int);
print "\n $year:$month_str:$month_int";
}
########################################
This works as expected, the problem is I am using a shell command and I
would like to move away from it. Is the perl module that is able to take
parameters juat like the 'date' command?