I've always been confused about extracting/referencing data returned in a hash. What's the proper way to pull specific fields/values out of a hash, for example, how do I reference the 'status' field value, or the 'field' value in this hash:

$VAR1 = { 'cookies' => { '_AVESTA_ENVIRONMENT' => 'prod', '_mcid' => ' +1.340667ccb3eb6552450356561ab6bd92.4410ca7570d70e1141356a24d924a2a789 +d1bea2b8a417b761406f755ab1d9ba' }, 'error' => '400 Bad Request', 'con +tent' => { 'detail' => 'The resource submitted could not be validated +. For field-specific details, see the \'errors\' array.', 'errors' => + [ { 'message' => 'This value should be of type object.', 'field' => +'merge_fields' } ], 'status' => 400, 'title' => 'Invalid Resource', ' +type' => 'http://developer.mailchimp.com/documentation/mailchimp/guid +es/error-glossary/', 'instance' => '59edf1fc-ed93-4a40-ba23-1f0af24a6 +eb3' }, 'raw' => '{"type":"http://developer.mailchimp.com/documentati +on/mailchimp/guides/error-glossary/","title":"Invalid Resource","stat +us":400,"detail":"The resource submitted could not be validated. For +field-specific details, see the \'errors\' array.","instance":"59edf1 +fc-ed93-4a40-ba23-1f0af24a6eb3","errors":[{"field":"merge_fields","me +ssage":"This value should be of type object."}]}', 'code' => '400', ' +header' => { 'Server' => 'openresty', 'Client-SSL-Cipher' => 'ECDHE-R +SA-AES256-GCM-SHA384', 'Client-Date' => 'Mon, 27 Jan 2020 18:37:43 GM +T', 'Date' => 'Mon, 27 Jan 2020 18:37:43 GMT', 'Client-SSL-Cert-Issue +r' => '/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=GeoTrust RSA CA 20 +18', 'Connection' => 'close', 'Client-Peer' => '23.55.203.69:443', 'C +ontent-Length' => '373', 'Client-SSL-Socket-Class' => 'IO::Socket::SS +L', 'Content-Type' => 'application/problem+json; charset=utf-8', 'X-R +equest-Id' => '59edf1fc-ed93-4a40-ba23-1f0af24a6eb3', 'Set-Cookie' => + '_AVESTA_ENVIRONMENT=prod; path=/, _mcid=1.340667ccb3eb6552450356561 +ab6bd92.4410ca7570d70e1141356a24d924a2a789d1bea2b8a417b761406f755ab1d +9ba; expires=Tue, 26-Jan-2021 18:37:42 GMT; Max-Age=31536000; path=/; + domain=.mailchimp.com', 'Client-SSL-Cert-Subject' => '/C=US/ST=Georg +ia/L=Atlanta/O=The Rocket Science Group, LLC/OU=IT/CN=*.api.mailchimp +.com', 'Link' => '; rel="describedBy"', 'Client-Response-Num' => 1 } +};

In reply to Proper Way to Reference a Hash Value by JEWebDes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.