use POSIX; my $pid = fork(); if ( $pid == 0 ) { setsid(); close STDIN; close STDOUT; close STDERR; RunCommand( ... ); }