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

perl will tell you what it thinks the problem is if you add or die $! on to the end of your open statements:
open(FH,">>$file") or die $!; open(FH,">>c:\\logfile.log") or die $!;

If they don't help you sort out your problem, you will have to show us some more code before we can help you further

PS

wrapping your code in <code> ... </code> tags will format it just like mine above.