But the value wouldn't be defined until it runs through the secondary module. I've tried simply stating:
my $exception = EcomImportUtilities::ageCheck(
...
...
...
exception => undef
but that seems to have no affect on the warnings. | [reply] [d/l] |
exception => undef
ikegami pointed out the likely culprit. But if you hadn't seen that, then what you just said is the opposite of what I would do after reading >>"Uninitialized" really means "has undef for value"<< in ikegami's first post. My recommendation would have been to figure out why the exception-key's value was being set to undef, not intentionally force it to undef.
To do that here, I would have made a print statement (This is step#2 from Basic debugging checklist)
printf STDERR "ref=%s, exception->{exception}=%s\n", $exception, $exception->{exception}//'<undef>';
... and placed it right before the return($exception) in your subroutine and just after the my $exception = EcomImportUtilities::ageCheck(...). This would have shown you that it was properly defined in the sub, but the hashref wasn't getting into the local $my exception at all, which would have pointed you toward ikegami's conclusion that the conditional-my was what was messing with you -- or, at least, you could have asked "why is $exception a proper hashref in the sub, and not after the subroutine-call?", at which point, ikegami would have chimed in.
Hope this helps you for future debugging
(edit: move the step#2 comment to subsequent paragraph, where it fits better)
| [reply] [d/l] [select] |