On Mon, Oct 06, 2003 at 03:57:30PM +0100, "Orton, Yves" <yves.orton@de.mci.com> wrote: > > It might also be worth mentioning Scalar::Util's reftype() and blessed() > > which are unambiguous in their functionality and often what people really > > should be using mean when use ref(), > > Arguably ref() should be deprecated and blessed() and reftype() moved into > core. isa() is an unsatisfactory means of determing variable type, as is > ref(). One awkward difference is that ref returns '' for a non-reference while reftype returns undef. > Also, as the pseudo-class Regexp is actually a core class facilitated by > magic it should not return SCALAR as its reftype. IMO it should return REGEX > instead. (And it should be possible to strigify it when blessed without > reblessing it into the class 'Regexp'. I have a patch for Scalar::Util to do > this, but its odd to me that the core logic doesnt handle this more > smoothly.) That last part was fixed in 5.8.1 and blead.Thread Previous | Thread Next