I am using Storable's dclone()
to create copies of various complex objects, which are self-logging with Log4perl loggers attached. Storable complains when it encounters the logger object because it contains CODE
refs. When I turn on the option to serialize code refs, I get the ominous warning
Useless use of a constant (???) in void context at (eval 1668) line 16.
Useless use of a constant (???) in void context at (eval 1668) line 10.
during the cloning process, and the cloned object's logger no longer functions.
The objects that I'm cloning are composed of other objects, and the loggers may be attached to the object, its components, their subcomponents, etc..
Ideally I would like the cloning process to ignore any logger objects.
1) Are there any Perl modules that would be (more) suitable for this task? Ideally I would like to be able to control the recursive copying so that only objects or pieces of data that weren't loggers were copied.
2) ...or would I be better off taking out the self-logging capabilities of the objects (sob!) from my objects and create loggers that aren't attached to the objects?
Any advice or insight would be appreciated.