my $today_wday = (localtime)[6]; my $then_wday = ($today_wday + $days_in_the_future) % 7;