#!/usr/bin/perl -w use strict; if (my $pid = open(READ, "-|")) { print "child said: '", scalar , "'; ",time,"\n"; print "child said: '", scalar , "'; ",time,"\n"; } else { $|=1; print "hello; ",time,"\n"; sleep 2; print "how are you; ",time,"\n"; } #### gryn@echor:~$ ./testcase.pl child said: 'hello; 1005597768 '; 1005597768 child said: 'how are you; 1005597770 '; 1005597770