open $fh, ">$filename" or die "could not open '$filename' for writing: $! "