open my $FILE, ">", "test.txt" or $failed_flag = 1;