in reply to open file does not work for externally defined filename

Just for the sake of completeness ... try Fatal if you're opening lots of files or maybe just feel like writing different boilerplate:

use Fatal qw(open close); #... open(FH, ">>c:\\logfile.log"); #..