my $buf; binmode STDOUT; while (read($fh,$buf,1024)) { if ($params->{win32_text}) { $buf =~ s/\n/\r\n/g; } print $buf; } } undef $fh;