Jonathan Musto wrote:
> 
> Hi all,

Hello,

> Does anyone know how to get the last six months into an array?
> 
> ive got:
> my $month = (split ' ', uc localtime)[1];
> to get the current month and now i want to get the previous 5 months, is
> there any way to perform arithmetic on the month value!??

$ perl -le'
@mons = ( qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/ ) x 2;
$mon = (localtime)[4] + 12;
print "@mons[$mon - 5 .. $mon]"
'
Jun Jul Aug Sep Oct Nov



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to