Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Iterative HOH or AOH?

by hbm (Hermit)
on Aug 06, 2012 at 19:18 UTC ( #985803=note: print w/ replies, xml ) Need Help??


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';.


Comment on Re: Iterative HOH or AOH?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985803]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (19)
As of 2014-09-23 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (224 votes), past polls