How to get a value from the given hash reference in Perl?

How can I get the value of "row" from the following hash reference?



x $report_href
0  HASH(0x1c917a0)
   'fileTobeChecked' => HASH(0x2077f80)
      '/some/dir/myfile.cpp' => HASH(0x289f750)
         'arrayofmatches' => 1
         'check' => '<font color=#9B9B00>  WARNING: The file type does not exist in the Coding Standards Database</font>'
         'checkListDetailsHtml' => '<br><b>Check 1:</b> <font color=#9B9B00>  WARNING: The file type does not exist in the Coding Standards Database</font><br><td>n/a <br></td></tr><br>'
         'checkListHtml' => '<td width:200px><font color=#9B9B00>  WARNING: The file type does not exist in the Coding Standards Database</font></td><td><a href="file://///some/dir/to/file/myFile.cpp" style="color: black">n/a</a></td></tr>'
         'checkResult' => 'n/a'
         'row' => 1
         'textColor' => 'black'

Open in new window

TolgarAsked:
Who is Participating?
 
FishMongerCommented:
I'm not sure at which level 'row is at, but it looks to be either:

print $report_href->{'fileTobeChecked'}{'row'};

Open in new window

or
print $report_href->{'fileTobeChecked'}{'/some/dir/myfile.cpp'}{'row'};

Open in new window


Based on the structure shown in some of your other posts, it's probably the first one.
0
 
farzanjCommented:
print $report_href->{'row'};

Open in new window


I am not exactly sure what are the keys so it will be an iterative process for me.
print keys %{$report_href};
0
 
ozoCommented:
$report_href->{fileTobeChecked}{'/some/dir/myfile.cpp'}{row}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.