@t = (localtime)[0..5]; $this_month = $t[4]+1; $previous_month = $t[4]; #### $this_month = (localtime)[4]; $previous_month = $this_month++ ? $this_month-1 : 12;