> I am trying to extract last month's date from today's date as in "Jan"
> or "Feb"is there a switch to enable that ?
Assuming you actually meant "extract last month's name based on today's date":
@months = qw(Jan Feb Mar Apr May Jun July Aug Sep Oct Nov Dec);
print $months[(localtime)[4]-1];
Sam Harris wrote:
> I am trying to extract last month's date from today's date as in
> "Jan" or "Feb"is there a switch to enable that ?
Not a 'switch'. I'm not sure what you had in mind.
You can get the current local date/time by calling 'localtime'.
In array context, this function returns a
Sam Harris wrote:
>
> I am trying to extract last month's date from today's date as in "Jan" or
>"Feb"is there a switch to enable that ?
Well im not sure what you want.
$ perl -we 'print join " ", localtime , "\n" '
27 24 15 11 1 103 2 41 0
$ perl -we 'print scalar localtime , "\n" '
Tue