[CDBI] Re: uniqueness of objects in memory??

Perrin Harkins perrin at elem.com
Mon Oct 24 23:13:32 BST 2005


On Mon, 2005-10-24 at 15:07 -0700, Phil Mitchell wrote:
> OTOH, I can run essentially the same code inside a single template
> inside my app:
> 
> [% prefs.home_page %]<br>  => X
> [% user.prefs.home_page %]<br>  => X
> 
> [% prefs.home_page('Y') %]<br>
> [% prefs.update() %]<br>
> 
> [% prefs.home_page %]<br>  => Y
> [% user.prefs.home_page %]<br> => X
> 
> ...and see the weird behavior.

Possible cloning side effects from the TT stash?

You can identify if the two refs are pointing to the same object by
printing their refaddr() values with Scalar::Util.

- Perrin





More information about the ClassDBI mailing list