in reply to Re^2: OO Perl: Nested classes question
in thread OO Perl: Nested classes question

Also I note that your "preferred way to call constructors" comment is just cargo culting unless you can give some concrete reasons why that is preferred. I'm betting that you can't.

That's hardly fair. Almost no one can explain every case in which indirect constructor invocation can fail badly with unintelligible error messages -- or was that the answer you wanted to hear? (It's the one I usually give.)

Replies are listed 'Best First'.
Re^4: OO Perl: Nested classes question
by tilly (Archbishop) on Sep 08, 2006 at 20:44 UTC
    I think it was fair. Repeating undigested information by rote provides fertile grounds for myth and rumor.

    Besides I'm unconvinced by your answer. I am unconvinced because it is also true that almost no one can explain every case in which direct constructor invocation can fail badly with unintelligible error messages. Here is an example:

    # We have some code, and somewhere wrote open(Foo, "> /dev/null") or die "Cannot write /dev/null: $!"; # Time passes... my $obj = Foo->new; # And elsewhere package Foo; sub new { bless {}, shift; } # ... 1;
    And yes, I know that you are in the set of "almost no one".