my @ymd1 = split ',',$dates[4] //= $prev_mth_end; my @ymd2 = split ',',$dates[5] //= $prev_mth_end;