in reply to Memory Leak

weaken() in Scalar::Util can be used to address these issues. There is a nice example of using weaken() to manage circular references at http://www.simplicidade.org/notes/archives/2005/07/weaken_referenc.html.