in reply to Problem handling complex data structure with XML::Simple

$VAR1->{OneUploadedFile}[0]{ChecksumResult}

Although you'd normally have a loop to loop over the OneUploadedFile array.

Replies are listed 'Best First'.
Re^2: Problem handling complex data structure with XML::Simple
by abullen (Initiate) on Aug 12, 2011 at 20:22 UTC
    Sorry, sorry, I am just not getting it. Sigh. Anyway, I (of course) neglected to fully describe the XML hierarchy. It is not simply OneUploadedFile:ChecksumResult It is DepositoryProcessingRecord:MultiFileDoc:OneUploadedFile:ChecksumResult So, in trying to extrapolate, I am getting Not an ARRAY reference at ./parseXML.pl line 46. Line 46 is: my $checkSumResult = $xmlRef->{DepositoryProcessingRecord}->{MultiFileDoc}->{OneUploadedFile}->[0]->{'FinalDocStoragePath'}; I apologize; I just can't get my head around this.

      I'm basing it on the var you dumped. If you dumped $x, replace $VAR1 with $x. If you dumped $xmlRef->{DepositoryProcessingRecord}->{MultiFileDoc}, replace $VAR1 with $xmlRef->{DepositoryProcessingRecord}->{MultiFileDoc}.

      If you did dump $xmlRef->{DepositoryProcessingRecord}->{MultiFileDoc} and you are now getting this error, then $xmlRef->{DepositoryProcessingRecord}->{MultiFileDoc} no longer contains what you showed us it contained, and you'll have to adjust the code according to what it contains now.