read($sourcefile, $buffer, 1024) or die "Cannot read sourcefile: $!"