in reply to Text File

It should be:

if (-e $new_file){unlink $new_file};

But most probably you just want to open the file for writing and overwrite it if it existed. You should most probably also do some flock()ing to ensure two instances of the script do not overwrite each others data.

Jenda