in reply to opening a file name with a $ in it

put single quotes around the filename. stuff in single quotes is not subject to variable-interpolation, as such:

open F,'>c:/windows/get/a/real/operating.$y$tem';
print F "haha\n";
close F;