#!/usr/bin/perl use warnings; use strict; use IPC::Open3; my $pid = open3(\*WRITE, \*READ, 0,"success.pl"); #if \*ERROR is false, STDERR is sent to STDOUT #get the answer chomp(my $answer = ); print "query = $answer\n"; waitpid($pid, 1); # It is important to waitpid on your child process, # otherwise zombies could be created.