in reply to Re: Re: where does the time go?
in thread where does the time go?
...okay then, how about this?
You didn't like this:
@t = (localtime)[0..5]; $this_month = $t[4]+1; $previous_month = $t[4];
But if it is changed slightly,
$this_month = (localtime)[4]; $previous_month = $this_month++ ? $this_month-1 : 12;
This idea raises hackles for me because it depends upon order of evaluation, and it "cleverly" hides the logic of its decision mechanism (as the conditional operator often does), but it does account for the border case.
---v
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: where does the time go?
by ferrency (Deacon) on Apr 24, 2002 at 18:50 UTC |