Sometimes "too much is as bad as too little" applies to information as well as other things. In this case, the info supplied by Data::Dumper::Dumper (or whomever you're using to dump your structure) may be confusing: all those  bless({ ... }, 'SomeThing') thingamabobs, what's that about? That's just the way your dumper utility represents a bless-ed reference; in fact, an object reference in this case.

A Perl object is simply a reference blessed into a package/class (see perlobj, perltoot, among others.). The reference is usually to a hash, but can be any kind of reference.

Shorn of its blessedness, the dumped data structure can be viewed as an array of anonymous hashes, with each hash harboring an anonymous sub-hash:

$VAR1 = [ { 'identifierType' => { 'summary' => 'Asset tag of the system', 'label' => 'Asset Tag', 'key' => 'AssetTag', }, 'identifierValue' => 'unknown', }, { 'identifierType' => { 'summary' => 'OEM specific string', 'label' => 'OEM specific string', 'key' => 'OemSpecificString', }, 'identifierValue' => 'Dell System', }, { 'identifierType' => { ..., 'key' => 'OemSpecificString', }, 'identifierValue' => '5[0000]', }, { 'identifierType' => { ..., 'key' => 'ServiceTag', }, 'identifierValue' => 'XXXXXXXX', }, ];
In fact, it's an array of objects, as shown by the  bless({ ... }, 'PackageName') wrapper of each anonymous hash, with each object containing, along with whatever else, a sub-object.

As has been pointed out, the blessedness of a reference does not prevent it from being accessed as an ordinary reference using the standard arrow operator:
    $VAR->[1]{identifierType}{label} = 'whatever';
    if ($VAR->[2]{identifierValue} eq ...) { ... }
However, Don't Do That! As davido has wisely advised, use the accessor/mutator (get/set) methods that are or should have been provided with the class. If such a method does not exist for the data you want to access, this may be telling you that you should not be accessing this data and should think again about what you want to do. (OTOH, lack of such a method may simply mean that the class is badly designed!)


In reply to Re: dereferencing ... again by AnomalousMonk
in thread dereferencing ... again by natxo

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.