in reply to Predefining complex data structures?
Why do you feel that this needs to be predefined? Or a better question is, how would you go about doing it given that the structure in its nature is open ended? That is to say, the array reference pointed to by the "requirements" key has no built-in limit, nor does there appear to be a maximum number of attributes in the embedded hash. Thus, if you were to predefine it in some way, you'd have to choose an arbitrary depth to which to do so.
As far as push()ing and shift()ing and what not is concerned, this should do it:
push(@{$tagstack{requirements}}, { text => 'foo', attributes => [ 'wha +tever' ] } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Predefining complex data structures?
by Ionizor (Pilgrim) on Jul 12, 2002 at 15:00 UTC |