Hi, Still fumbling around trying to retrieve values from, for me, complicated data structures
This is what Dumper shows (I’ve both trimmed and anonymoused the data, but hopefully have not screwed the structure)
bless( { 'allowedHostnames' => [ 'node1', 'node2' ], 'customerName' => 'GarbageA', 'expirationDate' => '2021-08-15T22:59:59.000Z', 'errorMessage' => undef, 'properties' => [ bless( { 'value' => '42000', 'name' => 'maxEngines' }, 'Property' ), bless( { 'value' => '', 'name' => 'brokerLeases' }, 'Property' ), bless( { 'value' => '', 'name' => 'amazonDevPay' }, 'Property' ), bless( { 'value' => GarbageD', 'name' => 'customer_ID' }, 'Property' ), bless( { 'value' => ' GarbageE', 'name' => 'LicenseID' }, 'Property' ) ] }, 'LicenseInfo' )
I can successfully get “GarbageA” for customerName, but cannot get 42000 for maxEngines – the error returned is “No such pseudo-hash field maxEngines"
This is the code I am using
Any help much appreciated. Regards, Nigelmy $soap2 = SOAP::Lite->uri( $_[1] )->proxy( $_[2] )->getLicenseInfo() +; my @licenseInfos = $soap2->result ; for ( my $i = 0 ; $i < @licenseInfos ; $i++ ) { my $license = $licenseInfos[$i]; print Dumper($license); my $licensedCustomer = $license->{'customerName'}; print "$licensedCustomer\n"; my $maxEngine = $license->{'properties'}->{'maxEngines'}; print "$maxEngine\n"; }
In reply to No such pseudo-hash field by nleach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |