wait; # wait for any previous child to finish my $pid = fork; die "Can't fork: $!" if ! defined $pid; if ( ! $pid ) { # child do_sqllite_stuff(); exit; # this is important }