The problem was that the "if" test always fail where it shouldn't. And I caught the bug after I put "print Dumper(@run)" after the first line, in other words, I was willing to accept that may be "if(@rum)" isn't what I think it is after all!my @run = MyClass->find_all(); if(@rum){ # do something, }else{ #do something else }
Of course, the bug was that I wrote "if(@rum)" instead of "if(@run)" (and my emacs font/coloring made it barely distinguishable). Why didn't I use strict? because I always use strict, I tell everyone to use strict, I've used strict all my life, and somehow I didn't this time, and I thought I was using strict!
I read some recent post here to the effect that "you don't have to use strict if you know what you're doing", I couldn't disagree more. I'd say, use strict, check twice you're using strict, and ask someone else to check you're using strict. You will live longer if you do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: That damn "strict"
by revdiablo (Prior) on Sep 15, 2005 at 23:14 UTC | |
by dragonchild (Archbishop) on Sep 16, 2005 at 01:07 UTC | |
by tilly (Archbishop) on Sep 17, 2005 at 05:38 UTC | |
by qbxk (Friar) on Jan 10, 2006 at 05:35 UTC | |
by si_lence (Deacon) on Jan 10, 2006 at 08:29 UTC | |
| |
by ysth (Canon) on Jan 10, 2006 at 08:30 UTC | |
| |
by tilly (Archbishop) on Jan 10, 2006 at 18:27 UTC | |
|
Re: That damn "strict"
by Hue-Bond (Priest) on Sep 16, 2005 at 08:39 UTC | |
by saberworks (Curate) on Sep 21, 2005 at 17:24 UTC | |
by Hue-Bond (Priest) on Sep 21, 2005 at 22:02 UTC | |
by ikegami (Patriarch) on Jan 12, 2006 at 18:31 UTC | |
|
Re: That damn "strict"
by ruoso (Curate) on Sep 16, 2005 at 20:04 UTC | |
|
Re: That damn "strict"
by sfink (Deacon) on Sep 19, 2005 at 17:21 UTC | |
by TimToady (Parson) on Sep 19, 2005 at 17:43 UTC | |
|
Re: That damn "strict"
by Anonymous Monk on Sep 20, 2005 at 14:15 UTC |