Sorry if the question is too rookie, I'm not a great, nor experienced coder.
I am using the VirusTotal API to pull some info about some files. It returns a hash, which is too complicated for my feeble brain. Data Dumper shows the following data structure, which is in $res1. To be clear, the ultimate goal is to be able to pull out 'Eicar-Test-Signature':
$VAR1 = {
'report' => [
'2011-01-25 10:30:50',
{
'AntiVir' => 'Eicar-Test-Signature',
...
}
]
};
It looks to me like a hash within an array within a hash within a hash. If I do
print ($res1->{'report'}[0]);
it returns '2011-01-25 10:30:50'. So far so good. I thought from here I need to do is change the code to
print ($res1->{'report'}[0]->{'AntiVir'}); to get the key value of 'Eicar-Test-Signature'. Instead it returns nothing. I know I am close, but after a few hours on this, I am turning to you guys.
Thanks much.
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.