in reply to Reg Expression on file name

I believe that you'll need to add a '.' just before the asterisk, as in:

next if($file !~ /^AB\sDAT.*\.doc$/i); ^
Otherwise, you'll only match strings like:
AB DA.doc
AB DAT.doc
AB DATTTTTTTTTTTTTT.doc

The way you have coded it, the asterisk refers to zero or more occurrences of the previous character, 'T', instead of "any character", as I think you intended.

Where do you want *them* to go today?