in reply to Create file in a specified directory

Change the text of your die message a trifle to include the $! (error message). I suspect that will give you a better feel for what is happening....
open $fh, ">$uniqueCaptureName" or die "can't open file -- $! \n";

----
I Go Back to Sleep, Now.

OGB