#!perl -w print <## use IO::Handle; use IPC::Open2; open FH, "perl test.pl|" or die $!; while () { chomp; print "test1:[$_]\n"; } close FH; my ( $rdrfh, $wtrfh ); my $pid = IPC::Open2::open2($rdrfh, $wtrfh, 'perl','test.pl' ); while (<$rdrfh>) { chomp; print "test2:[$_]\n"; } open FH, "perl test.pl|" or die $!; my $fd = IO::Handle->new_from_fd( fileno(FH), "r" ); while ( <$fd> ) { chomp; print "test3:[$_]\n"; } #### C:\WINDOWS\Desktop>perl t.pl test1:[Line one] test1:[line two] test1:[line three] ]est2:[Line one ]est2:[line two ]est2:[line three test3:[Line one] test3:[line two] test3:[line three] #### binmode $rdrfh, ':crlf';