SergioQ has asked for the wisdom of the Perl Monks concerning the following question:
I am using an API that I found on CPAN. One of the objects returned seems to be a cluster of hashes. So for instance I fill the object from the API:
$object->countries; use Data::Dumper; print Dumper $object->countries;
And I see all the data within each country. Obviously I would like to sort through it, so when I do:
$object->countries; print $object->countries;
I get back:
HASH(0x559dd38dad20)HASH(0x559dd378be08)HASH(0x559dd3779490)HASH(0x559dd37793a0)HASH(0x559dd378c2e8)HASH(0x559dd378c438)
HASH(0x559dd378c5e8)HASH(0x559dd378c708)HASH(0x559dd378c840)HASH(0x559dd378c960)HASH(0x559dd378ca80)HASH(0x559dd3798a08)HASH(0x559dd3798b28)
HASH(0x559dd3798c48)HASH(0x559dd3798d68)HASH(0x559dd3798ea0)HASH(0x559dd3798fc0)HASH(0x559dd37990e0)HASH(0x559dd3799200)HASH(0x559dd3799320)
HASH(0x559dd3799440)HASH(0x559dd3799560)
If it returned just one HASH(0x559dd38dad20) I'd get it and would just dereference it and go about my business, but these multiple hashes in one print out I just don't understand.
Eventually I'll figure out if the object is an array of hashes, a hash of hashes, one or many references, etc. etc.
But I'd like to know what it is that I have on my hands. It's not just a matter of speed but also just building up my knowledge. Can someone lend a hand please?
Thank you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What Perl object am I looking at here?
by haukex (Archbishop) on Dec 27, 2019 at 12:32 UTC | |
|
Re: What Perl object am I looking at here?
by 1nickt (Canon) on Dec 27, 2019 at 11:07 UTC | |
by haukex (Archbishop) on Dec 27, 2019 at 12:33 UTC | |
|
Re: What Perl object am I looking at here?
by bliako (Abbot) on Dec 27, 2019 at 11:55 UTC |