in reply to Paranormal leakage of previous value from conditionally set lexical variable

I can duplicate your results on Perl 5.16.3.

What do you expect your output to be? I expect to get the following warning when dow=7 since you don't set workday to a defined value:

Use of uninitialized value $workday in concatenation (.) or string

Tip #6 from the Basic debugging checklist: B::Deparse, but it doesn't reveal much.

Interesting to change 8 to 9:

while ($dow < 9) { ... 2 0 3 0 4 0 5 0 6 1 7 1 8 0

Replies are listed 'Best First'.
Re^2: Paranormal leakage of previous value from conditionally set lexical variable
by GotToBTru (Prior) on Mar 10, 2016 at 13:31 UTC

    8 is not 6 or 7; therefore the if sets $workday to 0.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)