--As of May 26, 2009 12:33:08 PM -0700, Bill Ward is alleged to have said:
How would you feel about ref($foo)->new();
--As for the rest, it is mine.
As a clone? Off the top of my head, I can't see what's that doing. A bit
of thinking (and reading) about ref() makes it understandable, if not clean.
Based on that, I'd say it's ugly, but works. If I expected to do that sort
of thing often I'd probably want to offer another method in $foo that would
do what I want. (Either 'clone' or 'duplicate' come to mind, but both
sound like they copy data as well as type. Maybe 'another'?)
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------