in reply to Re^2: Learning classes in Perl
in thread Learning classes in Perl

To be computer-linguistically pedantic, new is not a constructor, but a factory class method.

Meh, if you use it exactly like a constructor, its a constructor I tells ya

Replies are listed 'Best First'.
Re^4: Learning classes in Perl
by jdporter (Paladin) on Feb 20, 2016 at 16:48 UTC

    That's fine; you can say the "new" method of the CGI class is a constructor. But (a) you can't necessarily say that the "new" method of the FuQuux class is a constructor, and (b) you can't necessarily say that the "constructor" of the FuQuux class is named "new". Perl does not require either of these to be the case. It remains true that Perl does not have constructors as the term is understood in other OO languages.

    I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.