alexsc01 has asked for the wisdom of the Perl Monks concerning the following question:

I have this structure
't:Items' => { 't:CalendarItem' => { 't:Subject' => 'test', 't:Sensitivity' => 'Normal', 't:ExtendedProperty' => { 't:ExtendedFieldURI' => { 'PropertyType' => 'String', 'PropertyName' => 'event_id', 'PropertySetId' => 'c11ff724....' }, 't:Value' => '133113' }, 't:End' => '2012-04-26T08:00:00Z', 't:ItemId' => { 'Id' => 'AAAYAFNjb3....', 'ChangeKey' => 'DwAAAB......' }, 't:LegacyFreeBusyStatus' => 'Free', 't:Location' => {}, 't:IsAllDayEvent' => 'false', 't:Start' => '2012-04-26T07:00:00Z' }}
And I can get the value of $subject with
$subject = $response_xml->{'soap:Body'}->{'m:FindItemResponse'}->{'m:R +esponseMessages'}->{'m:FindItemResponseMessage'}->{'m:RootFolder'}->{ +'t:Items'}->{'t:CalendarItem'}->{'t:Subject'} ;
But how do I get the value of ExtendedProperty -> Value (in this example it should return 133113 /Scott

Replies are listed 'Best First'.
Re: Getting value from perl data structure
by Neighbour (Friar) on Apr 26, 2012 at 10:12 UTC
    Let's put the data of the CalendarItem you've shown in its own variable:
    my $hr_CalendarItem = $response_xml->{'soap:Body'}->{'m:FindItemRespon +se'}->{'m:ResponseMessages'}->{'m:FindItemResponseMessage'}->{'m:Root +Folder'}->{'t:Items'}->{'t:CalendarItem'};
    Now the subject and wanted value can be found thus:
    my $subject = $hr_CalendarItem->{'t:Subject'}; my $value = $hr_CalendarItem->{'t:ExtendedProperty'}->{'t:Value'};