my $configuredDayFromXML = "mon"; #obtain from configuration my @daysOfWeek = ('Sun', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat', 'Sun'); if ($configuredDayFromXML eq $daysOfWeek[(localtime)[6]]) { if (! check if we are between the start and end time) { perform action; } }