http://www.perlmonks.org?node_id=993632


in reply to recursive creation of attached objects?

I'm trying to make a binary tree object which uses a recursively called new() method to create a tree n nodes deep

I would think that the basic interface is wrong. "new" should create a "virgin" tree. There should be another method to add leaves to this tree $bin_tree->add_leaf(...), perhaps? I would not use the "new" method for this purpose.

  • Comment on Re: recursive creation of attached objects?