in reply to Re: The Grouping of Objects
in thread The Grouping of Objects

Your Smalltalk background is showing...

Perl uses reference counting, not true garbage collection. That means that the above, which creates circular references, will create memory leaks. Therefore you should only have the reference go one way.

What I would do is have Team be a class, and then have creating a player, and trading players, be methods of the Team object. The Player object would hold the name of the Team, but no direct reference to it.

I think that does a good job of reflecting your likely usage pattern without creating memory leaks...

UPDATE
Alternate answer. With 5.6 use Devel::WeakRef.