in reply to Unlinking...
Dunno why you've got open in there, the following ought to do what you want
chdir "/directory/with/files/to/kibosh"; unlink <*.txt>; [download]
Philosophy can be made out of anything. Or less -- Jerry A. Fodor