in reply to Iterative HOH or AOH?
You have a few choices.
- Give all your variables default values each time you enter the for-loop; and reassign if the corresponding hash keys exist;
- Or assign each variable the corresponding hash value or some default value (e.g., $version = (exists $sw{$product}{'ProductVersion'}{'version'} ? $sw{$product}{'ProductVersion'}{'version'} : 0););
- Or use a similar construct when printing (e.g., print "Version: " . ($version ? $version : 0););
- Or, turn off the warnings with no warnings 'uninitialized';.
|
---|
In Section
Seekers of Perl Wisdom