in reply to Deleting Files

Try replacing the following:
unlink @file or die "$!"; --- unlink "$data\\$_" || die "$!" for @file;

Your problem is that you're not in the directory the file is in, so your unlink is failing. (Worse is that you might delete the wrong file!)

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.