in reply to Re^2: Initialized Variable getting Uninitialized Warning
in thread Initialized Variable getting Uninitialized Warning

Sure, if ageCheck always returns an exception. But then it wouldn't be an exception, would it? So either add the necessary if, or rename the variable to something that makes more sense (such as "result").

(As for the line breaks, I added them so the code looks better on PerlMonks. There's no reason to keep them.)

Replies are listed 'Best First'.
Re^4: Initialized Variable getting Uninitialized Warning
by drw (Novice) on Feb 27, 2019 at 19:51 UTC

    Well said, and that makes perfect sense. Thank you so much for the help! Not only does this work exactly as I needed it to, I grasped a valuable new concept in programming.