my $buffer; open(DOWNLOAD, "< /path/requested_file") or die "Could not read file: $!"; binmode(DOWNLOAD); while( read(DOWNLOAD, $buffer, 4096) ){ print $buffer; } close(DOWNLOAD);