in reply to Should I be using tie for this?

Tie::File allows one to access a file as thought it were an array; one line of the file per array element. I don't know what a boardTree object is, but if you have control over over its source, you can have it write things to a file and access them from there via a tied interface...but only if it makes sense to access them as an array (which it looks like it might based on how you are initializing your array). Come to think of it, couldn't you tie your @holes array to Tie::File?

thor

Replies are listed 'Best First'.
Re^2: Should I be using tie for this?
by Plankton (Vicar) on Jun 16, 2004 at 21:27 UTC
    Thanks thor,
    That was a good suggestion. Unfortunately it didn't work. When my script executes ...
    # # link the holes # $holes[0]->setLinks( [ $holes[1], $holes[2] ] );
    ... it generates this error message ...
    Can't locate object method "setLinks" via package "hole=HASH(0x1a1c2e4 +) " (perhaps you forgot to load "hole=HASH(0x1a1c2e4) "?) at ./tieBoardTree.pl line 26, <$fh> line 3.

    Plankton: 1% Evil, 99% Hot Gas.