in reply to perl script to execute a single command for multiple entries
See the open documentation on opening and reading a file, and the unlink documentation on deleting files.