in reply to Re^6: Perl "new" command
in thread Perl "new" command

1. I just stated originally, that there is no built in new function in Perl.
2. I totally agree with you, that Perl's approach is very dangerous, but it doesn't change the fact, that - by the documentation I read - a constructor is simply a sub, that returns a blessed reference.
If not so, please point me towards the correct documentation, I am not a seasoned Perl veteran.

Replies are listed 'Best First'.
Re^8: Perl "new" command
by JavaFan (Canon) on Mar 01, 2012 at 13:29 UTC
    a constructor is simply a sub, that returns a blessed reference.
    Note that's not what you said before. There you said:
    I thought a constructor is any routine that calls the bless operator.
    which I find a silly and confusing term.

    BTW, just because something is mentioned in the documentation doesn't mean 1) it's useful, 2) it's true, or 3) I agree with it.

      You're right, I was sloppy!
A reply falls below the community's threshold of quality. You may see it by logging in.