nleach has asked for the wisdom of the Perl Monks concerning the following question:
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: No such pseudo-hash field
by Eliya (Vicar) on Mar 28, 2011 at 11:10 UTC | |
|
Re: No such pseudo-hash field
by ELISHEVA (Prior) on Mar 28, 2011 at 11:40 UTC | |
|
Re: No such pseudo-hash field
by moritz (Cardinal) on Mar 28, 2011 at 12:49 UTC | |
|
Re: No such pseudo-hash field
by theleftsock (Beadle) on Mar 28, 2011 at 11:22 UTC | |
by Eliya (Vicar) on Mar 28, 2011 at 11:41 UTC | |
|
Re: No such pseudo-hash field
by nleach (Novice) on Mar 28, 2011 at 11:54 UTC | |
|
Re: No such pseudo-hash field
by Anonymous Monk on Mar 29, 2011 at 14:39 UTC |