in reply to Parallel::ForkManager - doesn't run code after

I'm not familiar with Parallel::ForkManager, but one problem is that I don't see where the instance  $dbh is being created:
my $sth4 = $dbh->prepare( $sql4 ) || warn "Prepare Error: $!\n";
-Mark

Replies are listed 'Best First'.
Re: Re: Parallel::ForkManager - doesn't run code after
by Anonymous Monk on Jun 28, 2002 at 16:09 UTC
    Hi, $dbh does exist & was created earlier, it definately works as I retrieve data via it earlier in the script, if I replace the following code
    ------------------------------------------ } $pm->wait_all_children; print "Connecting for insert into jobs_run: JOBNO:$mjobno\n"; my $sql4 = qq { insert into jobs_run (jobname, datein, howmany, error +mesg) values ( 'attachmailer', sysdate, $scount, 'JOBNO:$mjobno')} | +| warn "Error: $!\n"; print "preparing Query"; my $sth4 = $dbh->prepare( $sql4 ) || warn "Prepare Error: $!\n"; print "executing Query"; $sth4->execute() || warn "Execute Error: $!\n"; print "Done"; ------------------------------------------
    with simple
    ------------------------------------------ print "Preparing Query"; print "Hello World\n"; ------------------------------------------
    it won't print "Hello World" or anything other command after that, but it will print "Preparing Query" which ||'s nothing. It's definately related to the ForkManager stuff, because if I comment it all out, everything works fine (except for not using the ForkManager stuff)