in reply to Re^2: How to initialize all variables
in thread How to initialize all variables

As we all very well know, “software configuration management” (that onerous approvals-process) really is a critical thing.   We cannot edge around it, and we really do not want to.   Nor should we have to.   If there is a defect in the code, then it is probably in the code:   in the code that your team has written; not in what made it to CPAN.   (Which code also made it through Test::Harness as a precondition to being successfully installed on your computer in the first place.)

“Root causes” are typically architectural, and as such they are often very expensive to fix.   They are like foundation problems on a house ... or worse.   But I also think that one of the worst “root causes” arise from the change process itself.   Someone finds a bug and, with or without documenting the change, “makes it go away.”   Trouble is, the problem only “goes away” symptomatically.   The underlying issue often remains ... concealed, un-addressed, and now even more thoroughly wrapped up in obfuscation than it ever was before.

Hence, you really have no choice but to dig down and find out why this thing is breaking.   Consider yourself very lucky, in fact, that the “incorrect value” that you are dealing with happens to be undef.   Perl knows how to die when a variable contains this particular value.   It won’t say a word, though, if a “2” is really supposed to be a “3,” even though this would merely be yet-another manifestation of exactly the same underlying problem...

Best advice?   Learn as much as you can about automated software testing, i.e. Test::Harness and all of its kin.   The stuff that you see CPAN doing, every single time you install or update something.   All of the source-code for how CPAN does this is right there.   The tools are well-developed and very refined.   Even if you begin only by creating test-suites for your most simple and foundational code, you will be amazed (as I certainly was) at what it turns up.   It is seriously like having the waters of the lake upon which you are confidently traveling ... getting ready for another release ... suddenly turned clear, and all around you, directly in front of you, are thousands of obstacles, land-mines, sharks, what-have-you ... every one waiting to be “discovered” and in the very worst possible way.   You obviously cannot finish this kind of thing, “ex post facto,” but you can surely start, and any-and-all progress that you make in this direction will be a massive step in the right direction.