http://www.perlmonks.org?node_id=925553

alain_desilets has asked for the wisdom of the Perl Monks concerning the following question:

I am using Data::Dumper to save the state of a very deeply nested object to file. The nested structure contains:

A) Duplicate references to the same sub-components

B) References to functions

The problem I am having is that, in order for the duplicate references to be read correctly as duplicates, I have to set:
local $Data::Dumper::Purity = 1;
But then, when the dumper encounters the references to functions, it outputs the following message:

Encountered CODE ref, using dummy placeholder at C:/Perl/lib/Data/Dumper.pm line 190.

If I set Purity to undef, then that message does not appear, but then the duplicate references are read as separate instances.

Is there a way around this issue?

Thx

Alain Désilets