|
|
| go ahead... be a heretic | |
| PerlMonks |
Re^2: Easy cloning leaving out selected attributesby mzedeler (Pilgrim) |
| on Apr 17, 2012 at 11:31 UTC ( #965493=note: print w/ replies, xml ) | Need Help?? |
|
The point is that some (few) attributes should never be cloned, while others should. In this case, I have some objects that are stored through KioukuDB, and it never makes sense that they get the same id as the original object. I have a role that provides default ids, so it would be nice to have the clone method default to that. Another thing I need to differentiate is between some attributes that should be shallow clones and others that should be deep clones (using the clone() method on them, of course).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||