http://qs1969.pair.com?node_id=445092


in reply to Re^4: System Function...script does not move until process ends.
in thread System Function...script does not move until process ends.

try something like:
use POSIX ":sys_wait_h"; sub startTheDB { (defined $pid = fork()) or die "Unable to fork!\n"; if ( !$pid ) { exec "StartTheDB" or die "Can't start the db!\n"; } else { do { $kid = waitpid(-1, WNOHANG); } until $kid > 0; } }
Note that you'll want to test the db from the parent after you return from the sub.


Updated: It still waits for the child - as pointed out by frodo72

Just a note that the scary looking stuff (e.g. the waitpid) is explained in the docs mentioned throughout this node and here
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."