in reply to Clear out old files in a directory

Hmm. The bourne shell really isn't going to like these:
system("echo 'deleted file' >& /tmp/delete");
And pretty much all your calls to system would be much better written just by opening a filehandle to /tmp/delete.

-- Randal L. Schwartz, Perl hacker