Heh! That's where the "untested" bit comes in, and without testing I suspect the fix is to change the two unlink lines:
unlink map {"C:\\Perl\\compress\\$_"} @compressFiles; #delete
+compressed files
unlink map {"C:\\Perl\\test\\$_"} @testFiles; #delete
+test files
readdir doesn't generate full paths so unless the current directory happens to be the directory containing the files to be deleted, the unlink will fail. The map generates the full path to each file to be deleted.
True laziness is hard work
|