I am having a problem where I have to check if a text file exists, if it does the file must to be deleted cause the cgi program will create a new file and will append new data to it. Here is an exemple of the check and delete but it's not working. And the program keeps appending more data to it.
my $new_file="new_test.txt";
if ($new_file){unlink $new_file};