open (OUTFILE, "filename"); --> open a file for read
open (OUTFILE, ">filename"); --> open a file to write. if the file exist, it will be replaced
open (OUTFILE, ">>filename"); --> open a file to write. if the file exist, it will append to the end of file
both 2 and 3 created the file if it does not exist yet
also, remember that you will need to have write permission to successfully run 2 and 3
for 1, it only works if the file exist
might also want to consider checking the return value of open(), since it may just return NULL if file doesn't exist (case 1) or if you don't have write permission (2 and 3)
-947-