in reply to Overloaded *CORE:: function not behaving correctly

IIRC, to overload core functions, you need to do it before the calling code (in this case, IO::Handle I'm guessing, since you are calling it as a method call, and only IO::Handle::read is actually trying to call the core function) is compiled.

Back up a little, and separate your two apparent issues. Verify that your overloading routine is actually called with a print statement in it. Check if croak is behaving correctly without the overloading and without the eval. Add things to the pot one at a time, so you can see what exact circumstances contribute to the failure you are seeing.

Apologies if you've already done this; if so, it's not clear from your description of the problem.

  • Comment on Re: Overloaded *CORE:: function not behaving correctly