tag:blogger.com,1999:blog-9112560338291574360.post8957979831530749450..comments2024-03-02T08:28:27.119+00:00Comments on LeoNerd's programming thoughts: Perl - constructors don't have to be called "new"LeoNerdhttp://www.blogger.com/profile/06161372680495361467noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-9112560338291574360.post-45462637235070589012013-08-30T21:14:10.972+01:002013-08-30T21:14:10.972+01:00There's nothing special about "new",...There's nothing special about "new", not even in "new Class". You could also write "from_frame Class".<br /><br />(Don't write either one though, because the syntax is ambiguous and can fail in ways that are difficult to predict.)chromatichttp://modernperlbooks.com/noreply@blogger.comtag:blogger.com,1999:blog-9112560338291574360.post-40275177895760775572013-08-30T20:58:46.632+01:002013-08-30T20:58:46.632+01:00IIRC there is.. because ->new is called if you ...IIRC there is.. because ->new is called if you do new Class... but no one uses new Class anymore right? Also factory constructors when appropriate, to be fair I'd have a ->new for truly raw/manual construction (from hashref)... and then have ->from_frame call ->new.Anonymoushttps://www.blogger.com/profile/08185254298048097278noreply@blogger.com