in reply to Wrong Results in checking if hash value is defined or not
Code has to be posted between <code> and </code>, it is not terminated by <endcode>. Read Markup in the Monastery for more info.
If you don't give us any sample data, all we can say is that yes, $moduleRef->{modRef}{$moduleName}{ioRef}{$net} does seem to be defined. What you can do is check what you actually have rather than "be sure". You could add the value in your print line : print "$net is part of hash, the value is $moduleRef->{modRef}{$moduleName}{ioRef}{$net}".
Your best option is probably to dump your output (with Data::Dump or Data::Dumper) because it helps you visualize the data you actually have, and helps you tell the difference between undef, 0 and the empty string.
Just add
use Data::Dump qw( pp ); at the top of your program, and print pp $moduleRef->{modRef}{$moduleName}{ioRef} before your loop.
Or if you don't want to install Data::Dump, use Data::Dumper; and print Dumper $moduleRef->{modRef}{$moduleName}{ioRef}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Wrong Results in checking if hash value is defined or not
by sandeep.waikar (Initiate) on Jun 30, 2017 at 09:38 UTC | |
by Eily (Monsignor) on Jun 30, 2017 at 09:51 UTC |