In addition to heeding the good advice offered in this thread you might also want to make sure that new_test.txt actually resides where you think it does. The cgi program you are running will probably be running in the cgi-bin directory and therefore will check that directory for the file.
If new_test.txt resides in another directory then you'll need to add the path to your $new_file variable: