in reply to Re: Data::Dumper: What the Cabal doesn't want you to know.
in thread Data::Dumper: What the Cabal doesn't want you to know.
Data::Dumper isn't meant for this, but it can be done.
use Data::Dumper qw( ); sub serializer { local $Data::Dumper::Purity = 1; local $Data::Dumper::Sortkeys = 1; # Optional, but requested local $Data::Dumper::Useqq = 1; # Optional. return Data::Dumper->Dump( [ $_[0] ], [qw( D )] ); } sub deserializer { my $D; eval( $_[0] ) or die ( $@ ); return $D; } my $text = serializer( $data ); my $copy = deserializer( $text );
[Woops, this was supposed to be a reply to the OP.]
|
|---|