[ic] Should Util::copyref copy coderefs?

John Young john_young at sonic.net
Fri Dec 19 23:36:14 EST 2003

Mike Heins wrote:
> Quoting John Young (john_young at sonic.net):
>>Does anybody know whether or not it is intentional that 
>>does not copy coderefs (references to subroutines)?
> How would you go about copying a coderef? Remember, that routine
> makes a copy of dereferenced items, not references.

I was wondering about that, myself ;-)

> If you want to look at what Storable, FreezeThaw and some others
> have done, you will see they don't copy coderefs either, though I
> think some are trying to use B::DeParse to try and get the equivalent.

Thanks for the quick reply.  This question came about due to
me generating the following error in RPC/Prefork mode with SubCatalog:

Died in server spawn: do not know how to copy CODE(0x878ebe8)

from a patched V4.9.7-200303310658's Util.pm.  I've quit using
SubCatalogs for now, so it's not an issue (to me).  Also, I had
trouble replicating the error (in order to test across systems
and versions)... but I was looking at copyref() and was curious
about the notion of copying a coderef, figuring perhaps it might
play a role in spawning daemons in prefork or some such thing.

Happy Holidays!

John Young

More information about the interchange-users mailing list