in reply to Paranormal leakage of previous value from conditionally set lexical variable
Don't see why, but it seems to be a problem of precedence. Try:
my $workday = 0 if not $dow == 6 && not $dow == 7; [download]