On Tue, May 26, 2009 at 12:27 PM, Shlomi Fish <[email protected]> wrote:

> On Tuesday 26 May 2009 21:22:33 Jonathan Yu wrote:
> > my $bar = $foo->new();
> >
> > Which would create a $bar of the same type as $foo. You lose this by
> > dropping the ->new part.
>
> Actually, Randal Schwartz recommends (and I agree with him) against using -
> >new() this way to create a new object of the same class as $foo. See:
>
> http://www.stonehenge.com/merlyn/UnixReview/col52.html
>
> [...] So, don't write code like that, and especially don't just cargo-
> cult that from the manpage into your code.


Seems like a reasonable analysis.  Which manpage has that example?  Why not
submit a doc patch to remove it?

How would you feel about ref($foo)->new();

Reply via email to