in reply to http waits on process
The problem is that when you call
You are essentially calling`$myscript &`;
In other words... you are waiting for the shell process to terminate... but the shell process (if it were interactive) would have returned a prompt imediately after firing off $myScript.`sh -c '$myscript &'`;
If you really want to fire off a background job from a perl process, and don't care about the output (btw: backticks imply that you do care about the output, but continuing imediately imply that you do not care about the output)... then you should do something more like this:
Which is somewhat akin to what the shell does when you launch the program foo by typing:my $pid = fork; die "Could not fork: $!" unless defined $pid; if (!$pid) { exec $myScript; }
[user@host]$ foo &
------------ :Wq Not an editor command: Wq
In Section
Seekers of Perl Wisdom