Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: access object values

by kcott (Archbishop)
on Jun 05, 2023 at 13:54 UTC ( [id://11152652]=note: print w/replies, xml ) Need Help??


in reply to access object values

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11152652]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2026-05-14 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.