in reply to Overriding bless for inside-out object safety

Overriding bless is something I have attempted, see Overriding CORE::GLOBAL::bless. There are some caveats, particularly concerning precisely when the override takes effect. Admittedly, the purpose I was intending was not for production use, but in leak tracing.

I posted my conclusions here; I have not yet released an updated Devel::Leak::Object, but I may do at some future point.

Hope this helps

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

  • Comment on Re: Overriding bless for inside-out object safety

Replies are listed 'Best First'.
Re^2: Overriding bless for inside-out object safety
by xdg (Monsignor) on Jan 04, 2006 at 17:17 UTC

    I was considering overriding it only for the current package, not globally, but the point in your conclusions about it needing to be done at compile-time are well taken. I went through a similar learning process overrriding rand for Test::MockRandom. The pod for that has a pretty good description of when and how such overriding needs to happen.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.