in reply to The darned Feb problem :)
in thread where does the time go?
($month, $year) = (localtime)[4..5]; # convert from index to 'normal' $this_months_year = $year + 1900; $last_months_year = $this_months_year; $this_month = $month + 1; # fix month if = 0 $last_month = $month; $last_month or $last_month = 12; # roll back year if this month is january ($this_month == 1) and $last_months_year--; $this = sprintf("%04d%02d", $this_months_year, $this_month); $last = sprintf("%04d%02d", $last_months_year, $last_month); @files_this = <companyname.com-$this??_log>; @files_last = <companyname.com-$last??_log>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Nice ugly hack
by RMGir (Prior) on Apr 24, 2002 at 19:29 UTC |