in reply to Use of uninitialized value

If the code works, the warning is annoying you, and the use of an uninitialized value on that particular line is actually expected, then just disable that warning. The "uninitialized" warning can be disabled using:

no warnings "uninitialized";

It is lexcially scoped, which means you can apply it to a whole file, or just a particular subroutine, or a single loop or if block.

The point of the warnings pragma is that it's supposed to help you, not hinder you. If you find yourself jumping through hoops to keep it happy, then it's not doing its job - it's supposed to be keeping you happy, not the other way around. So just disable it for the scope where it's being annoying.