Here is the code to delete a file using PERL:
unlink "test.txt";
What is the PERL code doing?
"unlink" is telling PERL to delete the file named "test.txt" file.
Not exactly the longest bit of PERL coding in the world, but effective nonetheless! Just make sure that you are deleting the correct file when using PERL. If you cut and paste a lot of code, it's easy to overlook the file name you want to delete and delete the wrong file. Don't ask how I know this!