binmode $inhandle, ':encoding(EBCDIC)'; while (<$inhandle>) { print $outhandle $_; }