in reply to Re: Print every past three months from current month
in thread Print every past three months from current month
my @months = qw( January February March April May June July October No +vember December ); # passing 4 for April, I should get "February March April", instead I +get: "March April May". f(4); sub f { my $i = shift; print join(',', @months[$i-2, $i-1, $i]), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Print every past three months from current month
by wazat (Monk) on Apr 01, 2014 at 16:11 UTC | |
|
Re^3: Print every past three months from current month
by AnomalousMonk (Archbishop) on Apr 01, 2014 at 18:48 UTC |