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

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.
  • Comment on Re^2: Problem handling complex data structure with XML::Simple

Replies are listed 'Best First'.
Re^3: Problem handling complex data structure with XML::Simple
by ikegami (Patriarch) on Aug 12, 2011 at 20:33 UTC

    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.