use IPC::Open3; use Symbol; use FileHandle; open ABC,">output.txt"; open DEF,">Eoutput.txt"; $WTR = gensym(); # get a reference to a typeglob $RDR = ">&ABC"; # and another one $ERRR = ">&DEF"; # and another one $pid = open3($WTR, $RDR, $ERRR,'date'); STDIN->autoflush(); STDOUT->autoflush(); ABC->autoflush(); $WTR->autoflush(); print $WTR "3//3//3 \n"; print $WTR "4//4/3 \n"; print $WTR "4/5/3 \n"; waitpid $pid,0;