my $parent_dbh = DBI->connect( ... ); if( my $pid = fork() ) { # do stuff... # >>> $parent_dbh may be cleaned up here, # >>> because it *is* in the child's scope exit 0; }