my $cmd = 'mplayer command line'; my $child_pid = fork(); die "Can't fork: $!" if ! defined $child_pid; if ( ! $child_pid ) { exec $cmd or die "Can't exec '$cmd': $!"; }
At that point, you have to remember to wait for the child at some point (with a $SIG{CHLD} handler). The documentation for fork discusses this.
In reply to Re: launching application from perl
by kyle
in thread launching application from perl
by prekursor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |