in reply to Re: Need Help Understanding Parsing XML into multi level struck
in thread Need Help Understanding Parsing XML into multi level struck

Definetly dumped the $tree once I started having problems.

I'm also using 'use strict', so spelling isn't an issue with the code.

I copied/pasted the tree output into the source in case I had mis-spelled a field name or list item.

I've exashed my O'Reilly cookbook for every example that I could canibalize, plus what I could find off CPAN examples.

I've scrubed the code and I can send it to you to pour over. It's not very big, just over 100 lines, mostly for clarity.
  • Comment on Re: Re: Need Help Understanding Parsing XML into multi level struck

Replies are listed 'Best First'.
Re: Re: Re: Need Help Understanding Parsing XML into multi level struck
by ralibm (Acolyte) on Mar 18, 2004 at 00:43 UTC
    Sorry I didn't awnser the other half of your question.

    $self is a ref to the Field structure. $self->$item is a ref to one of the keys in Field, dependant on the looping. $self->$item->$subItem is a ref to one of the keys in SubField for Field, again depending on the iteration of the loops.

    This is a ref to the value in the tree at $subItem for $item for Level2 for Level1.

    $tree->{Level1}->{Level2}->{$item}->{$subItem}

    This is supose to act as a setter for $self. $self->$item->$subItem ( ) ;

    Simply put, you get $subItem from tree and place it into $subItem of $self.
      If I'm understanding you correctly, you're not using proper syntax for hash references. If $self is a HASH ref, and $item is a key, then $self->{$item} and not $self->$item are what you want.