require "Comm.pl" &Comm'init(1.8); &set_traps; $program=&open_proc("some program"); ($success, $matched, $before_match, $after_match ) = &expect ( $program, 10(time out in sec), 'what you are expecting'); die "Time out\n" unless ($success); print $program "What you want to send to the program\n";