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


in reply to High level OOP query

I couldn't comment on the norm, but I think both are acceptable and which you use will be determined by what sort of object you are creating and how it will be used.

Personally, I tend to use new to create an empty object and then optionally call init from within new to populate it based on arguments to new. The advantage in doing it this way is that you can create an empty object efficiently or create a populated object with a single call from the calling routine, or create an empty object now and then populate it later by calling init directly from the calling routine. I don't see many downsides to this approach, certainly in the general case.

But yes, don't get bogged down by this. There are much bigger fish to fry in the wonderful world of OOP. And before you go too much further down the roll-your-own path have you looked at the Modern Perl book or directly at Moose/Mouse/Moo?


Updated to explain the call tree more clearly.