-----BEGIN PGP SIGNED MESSAGE----- Moin,
On Friday 04 November 2005 21:39, Pete Krawczyk wrote: > Subject: Re: Test::More behavior issue with Devel::Cover + patch > From: Ricardo SIGNES <[EMAIL PROTECTED]> > Date: Thu, 3 Nov 2005 13:14:34 -0500 > > }It was using ->isa instead of UNIVERSAL::isa because isa might be > }overridden. Surely the same could apply to ->can. > > I've been thinking about it, and it'd be nice to find out if the > object's been blessed insead of relying on UNIVERSAL::can in my patch. > The closest I've come to this is using Scalar::Util::blessed, but > Scalar::Util wasn't core until 5.7.3 (according to corelist) and > Test-Simple tests itself going back to 5.4.0. > > Stealing the code from Scalar::Util isn't necessarily the best fix > either. > > Does anyone have a better way of checking whether an object is blessed > that's backportable through core? Not sure if a ref() check will suffice, but you could also always call: $object->can(); if it is not defined, it would use UNIVERSAL::can, otherwise the overriden one. Or do I miss something? Best wishes, Tels - -- Signed on Fri Nov 4 21:48:35 2005 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. This email violates U.S. patent #4,197,590: for (x = 0; x < widht; x++) { for (y = 0; y < height; y++) { setPixel (x+xm, y+ym, getPixel(x+xm,y+ym) ^ getCursorPixel(x,y); } } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iQEVAwUBQ2vJdncLPEOTuEwVAQHARwf8DUPXYgNKWk7EWLRpme+CvwzzS5J5hJGD 4K3ZJcI/j5zScW1AMd+cCpUMOnjXrHmNAZmIIkxBPwHFdgHDKbrD/uA/OIvkH9ws kgy+T6joTghYYAEIlCHLEl2UUsytxnjwBJVdmDm3SWrVw4b/ZHX3AEpVHEsRAMvu XY7nmjjfCekOvkTTek6ANgCfBiu5ypwhkib0k9TiCpxX60uNC4IlKCpdH09Up1Ov 129j8Yxtau3he3r62o8+epBDdRMj6wQUM3+yNWIeJh4LrKipetw1XKbx5JLqiPBi cFUjVQBYWggTaFetwU5Ei/vDvaUsZX2g1IXi5D+h+0c5qNmtvxMR2g== =9JIP -----END PGP SIGNATURE-----