more useful options | |
PerlMonks |
Re: Lazy conditional, skips assignment.by roboticus (Chancellor) |
on Mar 25, 2015 at 19:50 UTC ( [id://1121332]=note: print w/replies, xml ) | Need Help?? |
If the first clause of an AND is false, or if the first clause of an OR is true, there's no reason for perl to evaluate the right side of the expression. Side effects in expressions often have issues like this. In your case, it looks like you're just trying to pack too much stuff in a single conditional. When I look it over, I wonder what the heck it's doing. Yeah, I can figure it out, but I'd rather work on code that I can read, rather than decipher. Breaking it down into discrete units will make it simpler to read, and easier for you to debug, as well! Update: I think your code is probably trying to do this (roughly):
Update 2: After seeing hdb's response, I adjusted my code so it wouldn't return in test mode even when the oven is empty. ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|