[tpm] why wouldn't violating "use warnings" always be fatal?

Mark Fowle mfowle at navicominc.com
Tue Aug 26 13:27:00 PDT 2014


I've encountered something like this before.
The obvious but not likely: different module versions

And the often overlooked: Code running inside an if (server is dev){...}

If you have chunks of code running in dev only check them.

Some development houses get around this by having a dev server.
a staging server that runs the full code but off a different datastore
and a live server.

The staging server tests the code as it would run in the live environment.



-----Original Message-----
From: toronto-pm on behalf of Indy Singh
Sent: Tue 8/26/2014 4:12 PM
To: Fulko Hew; toronto-pm at pm.org
Subject: Re: [tpm] why wouldn't violating "use warnings" always be fatal?
 
Maybe it is a timing issue.  It may be running more slowly on the production system and when you run it with the debugger.

You get the error when you run it with the debugger, but what happens if you start it with the debugger but place no breakpoints in the code?

Perhaps you can reproduce the error message with some sleep statements placed at the same spots as where you stopped with the debugger.

Indy Singh
IndigoSTAR Software -- www.indigostar.com

From: Fulko Hew 
Sent: Friday, August 22, 2014 2:32 PM
To: toronto-pm at pm.org 
Subject: [tpm] why wouldn't violating "use warnings" always be fatal?


I just got bitten by different behavior on different platforms,
and I can't justify it. Perhaps someone out there can?

Platform #1: Perl 5.8.8 on Fedora    (development system)
Platform #2: Perl 5.8.8 on Debian    (production system)

It turns out my application _did_ have a bug in it, but it wasn't
detected during my testing when run on the dev sys, but failed
when the same dataset was encountered on the production system.

a) I have 'use strict' and 'use warnings' in my app.
b) I had an uninitialized variable used in a print statement.

On the production machine... my app died with the error:
'Use of uninitialized value in concatenation'
just as you would expect.

But on my dev sys, the app doesn't die, or even complain!

Once I found out what was happening, I ran it under the debugger on my dev sys,
and when I stepped through the print statement... It bitches and dies.
But without the debugger,  all is (apparently) happy.
(That's why I didn't detect and fix the bug during testing.)

So...
Why would my dev sys only flag and die under the debugger (and not with a normal run)?
And why does my prod system, work correctly (ie. flag and die) ?







--------------------------------------------------------------------------------
_______________________________________________
toronto-pm mailing list
toronto-pm at pm.org
http://mail.pm.org/mailman/listinfo/toronto-pm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20140826/d856f76b/attachment.html>


More information about the toronto-pm mailing list