my $inpfsz = 0; open(RESFIL, ">$desfnm"); binmode(RESFIL); while (my $inpcnt=read($srcfnm,$inpbuf,2096)) { $inpfsz += $inpcnt; print RESFIL $inpbuf; } close(RESFIL);