in reply to deleting links but not files

You want to take a look at the file test operators ("-X" in perlfunc). -l returns true if the file is a symbolic link.

hope this helps,