G'day Kallewirsch,

There are a number of modules that will give you a snapshot of an object. Here's a selection (all of these are configurable; see doco for details):

Here's a quick example of each:

$ perl -E ' use strict; use warnings; use Net::DNS::Packet; my $obj = Net::DNS::Packet::->new(qw{example.com MX IN}); say "\n*** Data::Dumper"; use Data::Dumper; print Dumper $obj; say "\n*** Data::Dump"; use Data::Dump; dd $obj; say "\n*** Data::Printer"; use Data::Printer; p $obj; ' *** Data::Dumper $VAR1 = bless( { 'status' => 0, 'authority' => [], 'answer' => [], 'additional' => [], 'question' => [ bless( { 'qtype' => 15, 'qclass' => 1, 'qname' => bless( { 'label' +=> [ + 'example', + 'com' + ] }, 'Net::D +NS::DomainName1035' ) }, 'Net::DNS::Question' ) ] }, 'Net::DNS::Packet' ); *** Data::Dump bless({ additional => [], answer => [], authority => [], question => [ bless({ qclass => 1, qname => bless({ label => ["example", "com"] }, " +Net::DNS::DomainName1035"), qtype => 15, }, "Net::DNS::Question"), ], status => 0, }, "Net::DNS::Packet") *** Data::Printer Net::DNS::Packet { public methods (38): additional, answer, answerfrom, answersize, authority, data, d +ecode, dump, edns, encode, from, header, HEADER_LENGTH, new, pop, pre +, prerequisite, print, push, question, reply, sign_sig0, sign_tsig, s +igrr, size, string, truncate, UDPSZ, unique_push, update, verify, ver +ifyerr, zone Carp: carp, confess, croak Net::DNS::Parameters: dsotypebyname, dsotypebyval private methods (1): _section internals: { additional [], answer [], authority [], question [ [0] Net::DNS::Question ], status 0 } }

See also:

— Ken


In reply to Re: access object values by kcott
in thread 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.