my $myString = "This is a test\nthis is only a test\n"; pipe(READER, WRITER); if(fork()) #should have some error checking { close(WRITER); while() { print "I just read: $_"; } } else { close(READER); print WRITER $myString; close(WRITER); exit; }