use DBM::Deep; use Data::Dumper; use Test::More no_plan => 1; package Foo; sub new { my $c = shift; bless { @_ }, $c } package Bar; sub new { my $c = shift; bless { @_ }, $c } package main; my $dbh = DBM::Deep->new( 'db.db' ); my $foo = Foo->new( bar => Bar->new( x => 1 ), ); my $expected = Dumper( $foo ); $dbh->import( foo => $foo ); my $foo2 = $dbh->export( 'foo' ); my $actual = Dumper( $foo2 ); is( $actual, $expected );