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