once you are set to the right path there are a variety of file tests available, one of which is -e to test if it exists. Usage could look like:
die "Don't overwrite a file that already exists\n" if -e $filename;
Being new to this myself I had to open up the llama book for reference (its chapter 11, page 155 of the 4th edition) or hidden in chapter 3 of the cammel.