Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Paranormal leakage of previous value from conditionally set lexical variable

by toolic (Bishop)
on Mar 09, 2016 at 19:25 UTC ( [id://1157207]=note: print w/replies, xml ) Need Help??


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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1157207]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found