in reply to Re^4: Windows folder access error (guessing)
in thread Windows folder access error

Add the special variable $^E into your die statement.

opendir (DIR, $directory) or die "$!\n***********\n$^E\n";