I need to get the 'identifierValue' => 'XXXXXX' with IdentifierType key 'ServiceTag'$VAR1 = [ bless( { 'identifierType' => bless( { 'summary' => 'Asset ta +g of the system', 'label' => 'Asset Tag' +, 'key' => 'AssetTag' }, 'ElementDescription' +), 'identifierValue' => ' unknown' }, 'HostSystemIdentificationInfo' ), bless( { 'identifierType' => bless( { 'summary' => 'OEM spec +ific string', 'label' => 'OEM specif +ic string', 'key' => 'OemSpecificS +tring' }, 'ElementDescription' +), 'identifierValue' => 'Dell System' }, 'HostSystemIdentificationInfo' ), bless( { 'identifierType' => bless( { 'summary' => 'OEM spec +ific string', 'label' => 'OEM specif +ic string', 'key' => 'OemSpecificS +tring' }, 'ElementDescription' +), 'identifierValue' => '5[0000]' }, 'HostSystemIdentificationInfo' ), bless( { 'identifierType' => bless( { 'summary' => 'Service +tag of the system', 'label' => 'Service ta +g', 'key' => 'ServiceTag' }, 'ElementDescription' +), 'identifierValue' => 'XXXXXXXX' }, 'HostSystemIdentificationInfo' ) ];
$VAR1 in Data::Dumper is an anonymous array
I tried this (among other stuff:my $add_info = $host_view->summary->hardware->otherIdentifyingInfo;
But I get "Undefined subroutine &HostSystemIdentificationInfo::_identifierValue called at script line 24" so I am failing miserably. Any help greatly appreciated.foreach (@$add_info) { if ( $_->identifierType->key eq "ServiceTag" ) { print $_->_identifierValue , "\n" ; } }
In reply to dereferencing ... again by natxo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |