in reply to Re^2: new() function: incorrect?
in thread new() function: incorrect?
I wouldn't recommend:
either. And, if I ever wanted to have a new object of the same class as another I'd prefer:$obj->new(...) ;
because (once you've worked out WTF is happening) it says exactly what is intended.ref($obj)->new(...) ;
However, on the general basis "Be strict in what you send, but generous in what you receive", throwing a run-time error at $obj->new(...) strikes me as ungenerous. Noting that perlobj for 5.10 (and 5.8.8) describes how to cope with this eventuality -- as the fourth in a sequence of increasingly complete object constructors.
|
|---|