Hi thanks for the response. please find the hash table that i defined. using the Data::Dumper the structure is desplayed as expected.
%Myhash = (
'SuperUser' => {
'Username' => '1',
'UserPage 0' => {
'UserPage_num' => '0',
'data' => {
'field1' => {
'name' => 'Version',
'Size' => '1'
},
'field2' => {
'name' => 'Length',
'Size' => '6'
},
'field3' => {
'name' => 'Number',
'Size' => '8'
},
},
},
'UserPage 1' => {
'UserPage_num' => '2',
'data' => {
'field1' => {
'name' => 'Version',
'Size' => '4'
},
'field2' => {
'name' => 'Length',
'Size' => '8'
},
'field3' => {
'name' => 'Number',
'Size' => '8'
},
+
},
},
And so on....
Here all the values are predefined so i am not making any changes in the Hash table. I am just trying to retrieve the values from the hash table. Here is the code where i am getting issue with in line no 209
206 foreach $item (keys %Myhash){
207 if ($item eq $My_Value) {
208 foreach $iteminitem (sort(keys %{$Myhash{$item}})){
209 foreach $iteminitem1 (sort(keys %{$Myhash{$item}{$iteminitem}}
+)){
210 if ($iteminitem1 eq 'name' && $user_number == $Myhash{$item}{
+$iteminitem}{$iteminitem1}) {
211 my $User = $iteminitem;
212 }
213 }
214 }
215 }
216 }
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.