in reply to Re: Correct idiom for default parameters
in thread Correct idiom for default parameters

Object constructors are generally called as class or objects methods Test->new([args])
There's only one object constructor in Perl, and it's called bless. Test->new is nothing more than a class method, that just happens to return an object, often of the same class. More often than not, programmers decide said new() creates a brand-spanking new object, which gets initialized as well. These programmers make it hard to do MI.

Replies are listed 'Best First'.
Re^3: Correct idiom for default parameters
by Your Mother (Archbishop) on Apr 29, 2010 at 14:07 UTC

    I know. I was guessing that was understood though perhaps being so explicit would have been helpful here for the OP.

Re^3: Correct idiom for default parameters
by Anonymous Monk on Apr 30, 2010 at 09:06 UTC
    I don't understand ...

    Imho it's common and accepted terminology to call methods returning member objects "constructors"

    --lanx

      Accepted terminology is irrelevant when you're picking nits
        not even nitpicking ... perlobj is full of examples where such methods are called "constructors".

        Cheers Rolf

      That terminology dates from the same time people thought hashref based objects were great. Just because people repeat others doesn't make them right. Or not use confusing terminology. If new is an object constructor, then what does bless create? Santa Claus?