use File::Spec; my $devnul = File::Spec->devnull(); print $reply_to_user; die "cannot fork: $!" unless defined ( my $pid = fork() ); if ( $pid ) { #this is the parent. exit; } else { #this is the child open STDOUT, ">$devnul" or die "Can't write to nowhere: $!"; open STDERR, ">$devnul" or die "Can't write to nowhere: $!"; sleep( 10 ); #do stuff }