in reply to BerkeleyDB question

You can use fork to do this effectively.
There are module that can save you time coding that could do this for you too.
Parallel::ForkManager, AnyEvent::ForkManager, Proc::Fork and Apache::fork just to name a few.
There are more modules that do fork.

Updated: or try forks::BerkeleyDB

Updated 2: In your two scripts you have warnings twice -w and use warnings; they both do the same thing.

Replies are listed 'Best First'.
Re^2: BerkeleyDB question
by afoken (Chancellor) on Jun 18, 2016 at 10:49 UTC
    Updated 2: In your two scripts you have warnings twice -w and use warnings; they both do the same thing.

    Not quite: -w and $^W both affect all files loaded, including all modules, whereas the scope of use warnings; is limited to the current block, or the current file if used outside blocks. See warnings and perllexwarn for details.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)