in reply to Re: calling a method within a constructor
in thread calling a method within a constructor

Thank you, this works fine for me! (It isn't that nifty because you have to watch the order (what is seemingly a peculiarity of perl), but hey, it works!)

tennis players have fuzzy balls.

  • Comment on Re^2: calling a method within a constructor

Replies are listed 'Best First'.
Re^3: calling a method within a constructor
by dragonchild (Archbishop) on Apr 11, 2007 at 11:34 UTC
    It's a peculiarity only if you want Perl to behave as other OO languages.

    OOP, if you listen to the purists, is about taking some data and some behavior and associating the two of them such that you can call behaviors on the data. That most OO language designers think programmers are too stupid to be entrusted with the mechanics of this isn't Perl's problem.

    As for constructors, there's nothing magical about new() at all. DBI uses connect() as the constructor - there is no new().


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?