pipe (IN,OUT); my $pid = fork (); die("fork failed") if (!defined($pid)); if ($pid == 0 ) { #the child exec ('programname -help'); } else { #parent sleep (2); #printing the newline character in the child process print OUT "\n"; waitpid ($pid,0); }