Re: Constructor API opinions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Quoted text here. Click to load it
Quoted text here. Click to load it

I would have


(both returning the object, of course) with


shortcuts that call 'new' with default parameters. You can test if
you're being called on the class or an object with 'ref', so
something like

    sub pull {
        my ($self, $id) = @_;
        ref $self or $self = $self->new;


You poor take courage, you rich take care:
The Earth was made a common treasury for everyone to share
All things in common, all people one.
'We come in peace'---the order came to cut them down.       []

Site Timeline