I have an object defined in the file act.pm as:

package Act ;
use Class::Struct ;
struct Act => {
         
        nxt     => '$' ,        # Pointer to next Act
        lev     => '$' ,        # Level for this Act 
        ln      => '$' ,        # Line Number
         
        cnt     => '$' ,        
        pz      => '$' ,        # Posistion in File
        typ     => '$' ,        # Act type ("M", "F", "E")
         
};
1 ;

Then in my main program I have:


use Act ;



        How does one create an array of objects of type act ?.

        Each individual object needs to be created.

I can't see
        
        my $gActs[1000] = new act ;

working.

If I do:
        my @gActs ; 

when I later try to assign
        
        $gAct[10] = new act ; 

I get errors because $gAct[10] is not of type act.


        I started a while ago with a copy of the pink camel which was
great but does nto address objects at all. I just received a copy of the
blue camel and besides being in way over my head, I am sure the answer
is in there staring at me, but I can't find it.

        It is actually not strictly necessary to use an array of
objects. A linked list would work fine, but so far I have not seen
anything that tells my how to point anything besides a single variable
at an object.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to