in reply to use of eval and Data::Dumper

FYI: In the case of DBMs, you could use perldbmfilter.

Taken from Ten Things You (Probably) Didn't Know About Perl by Simon Cozens, linked at An index to The Perl Journal articles on Dr. Dobbs:
my $db = tie %hash, "DB_File", "test.db"; use Storable qw(freeze thaw); $db->filter_store_value(sub { $_ = freeze($_) }); $db->filter_fetch_value(sub { $_ = thaw($_) }); $hash{"Larry Wall"} = Person->new(...);