in reply to Do people find warning for undef with string compare useful?
Yes to the headline question. I've probably disabled it 3 or 4 times in (a guess) 25,000 scripts I've written.
And then only temporarily until I worked out the proper way to prevent the warning rather than silence it.
How do people find the warning useful for 'eq'/'ne'?
Simple. If one of the variables in a comparison is undef, I either typoed, or I forgot to initialise it. A case of a class 1 beginner's error that I still make after 30 years doing this.
And that warning tells me I made it (again), the first time I run the code; rather than it languishing as a latent bug that Sod's Law says will strike at exactly the worst moment.
Anyone who disables it de rigor; or worse, skips warnings altogether as too much work, is simply kidding themselves.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Do people find warning for undef with string compare useful?
by perl-diddler (Chaplain) on Jun 01, 2013 at 01:59 UTC | |
by BrowserUk (Patriarch) on Jun 01, 2013 at 10:31 UTC | |
by perl-diddler (Chaplain) on Jun 01, 2013 at 13:17 UTC | |
by BrowserUk (Patriarch) on Jun 01, 2013 at 15:00 UTC |