Complex Objects in Perl

From: John Smith (someone_at_microsoft.com)
Date: 12/03/04


Date: Fri, 3 Dec 2004 08:20:37 -0500

Can someone point me to an example of how to implement and access the kind
of object shown below?

Most of the examples if found are an object that contains one other object.
I need to create an object that contains a hash of sub-objects each
sub-object is made up of a number of different objects and an array of an
object type.

Object1 contains scalars

Object2 Contains scalars

Object3 contains scalars (OK that part is easy)

Object4 contains an Object1, an Object2, an array of Object3, and scalars

Object5 contains a hash of Object4 and scalars

Object6 contains a hash of Object5

In general I will get or set each element in each object individually.

The ability to enumerate the object3s in the Object6 and the ability to

Enumerate through the object4s an object5 are the only other complex
accesses I need.

Thanks,

-Pat



Relevant Pages

  • Re: Help with tied/nested data structures
    ... also tie the containing hash. ... tied scalars. ... After I tie the scalar, ... FETCH ...
    (comp.lang.perl.misc)
  • Re: Help with tied/nested data structures
    ... had a plain hash that had a few scalars inside of it that were tied. ... However, once I did this, I broke the tied scalars. ... After I tie the scalar, it nearly gets immediately culled by the Perl ...
    (comp.lang.perl.misc)
  • Re: reference to a hash
    ... understand why you have to pass the check_items_for_all subroutine a ... Why can't you just pass it the hash itself... ... The Perl model for function call and return values is simple: ... functions are passed as parameters one single flat list of scalars, ...
    (perl.beginners)
  • Help with tied/nested data structures
    ... had a plain hash that had a few scalars inside of it that were tied. ... However, once I did this, I broke the tied scalars. ... sub TIEHASH { ... # Get the first key from a tied hash ...
    (comp.lang.perl.misc)