On Mon, Jun 27, 2005 at 11:20:07AM +0100, Fergal Daly wrote: > > I'm perfectly happy to punt this problem over to B::Deparse and let them > > figure it out. As it stands B::Deparse is the best we can do with code > > refs. What's the alternative? > > I'd argue that currently the best you can do is == because it never > gives a false positive. Consistent false negatives are harmless.
But it does reduce its utility. Means you can't use is_deeply() to test serialization. How important is that, I wonder. It also means code refs are treated differently than all other refs. In all other cases we peek inside the data referred to by the reference. That's why its a "deep" check. > I'm not sure. My suggestion is rather than facilitating it behind the > scenes, make it explicit and force it done by hand. > > It's actually the sort of thing that can be done as an extension to > Test::Deep. is_deeply() is "bestest for the mostest". Test::Deep handles all the configurable comparisons. Glad its there so I don't have to worry about that part. :) > If someone really wanted, they could use XS to create subref_eq which > pokes around inside closures, comparing the code and also comparing > the value of closed variables but that seems extreme, At that point you might as well just fix B::Deparse. -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern Don't try the paranormal until you know what's normal. -- "Lords and Ladies" by Terry Prachett