Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: simple OO constructor

by japhy (Canon)
on Sep 23, 2001 at 01:43 UTC ( #114097=note: print w/replies, xml ) Need Help??


in reply to simple OO constructor

Some people think $obj->new is "wrong". Regardless, I'd shrink the constructor to:
sub new { bless {}, ref($_[0]) || $_[0]; }

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://114097]
help
Chatterbox?
[ambrus]: We're not really sure. There are some other contenders like libjpeg, and it's not easy to tell how you even measure this.
[ambrus]: But we figured it's close.
[Corion]: If you take Android as the baseline, that makes all three a likely contender
[choroba]: 22 points until level 22

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-09-25 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (280 votes). Check out past polls.

    Notices?