while (my $bytes = read($resumefilename, my $buffer, 1024)) { $resumefile .= $buffer; }