Hi, I am strugling to access the values of an object.
Net::DNS::Packet=HASH(0x560a2c51be98) 'additional' => ARRAY(0x560a2c643678) empty array 'answer' => ARRAY(0x560a2c4ea600) 0 Net::DNS::RR::PTR=HASH(0x560a2c650780) 'class' => 1 'owner' => Net::DNS::DomainName1035=HASH(0x560a2c6504f8) 'label' => ARRAY(0x560a2c6506d8) empty array 'origin' => Net::DNS::DomainName=HASH(0x560a2c6507b0) 'label' => ARRAY(0x560a2c650798) 0 20 1 171 2 191 3 185 4 'in-addr' 5 'arpa' 'ptrdname' => Net::DNS::DomainName1035=HASH(0x560a2c650960) 'label' => ARRAY(0x560a2c650948) 0 20 1 'bl' 2 'bot' 3 'semrush' 4 'com' 'rdlength' => 23 'ttl' => 273 'type' => 12 'authority' => ARRAY(0x560a2c63e350) empty array 'count' => ARRAY(0x560a2c6503c0) 0 1 1 1 2 0 3 0 'id' => 31152 'question' => ARRAY(0x560a2c51c270) 0 Net::DNS::Question=HASH(0x560a2c6438e8) 'qclass' => 1 'qname' => Net::DNS::DomainName1035=HASH(0x560a2c63edd0) 'label' => ARRAY(0x560a2c650480) 0 20 1 171 2 191 3 185 4 'in-addr' 5 'arpa' 'qtype' => 12 'replyfrom' => '127.0.0.1' 'replysize' => 80 'status' => 33152 'xedns' => Net::DNS::RR::OPT=HASH(0x560a2c650a50) 'owner' => Net::DNS::DomainName1035=HASH(0x560a2c4c81c0) 'label' => ARRAY(0x560a2c4c8160) empty array 'type' => 41
As you might imagine, I look for a way to grab answer-ptrdname-label. I have tried:
@$obj{answer)
which at least gives me a part of the object. The same as the method $obj->answer(). But then I am stuck! Help appreciated!
Regards Kallewirsch

In reply to access object values by averlon

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.