Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I can not open a file with a $ in the name. The file name is mdns.$catalog (note this is on a win32 system). If I rename the file removing the $ all works as expected. I've tried using a \ to escape the $ but that doesn't seem to work either. Thanks in advance for any help.

Replies are listed 'Best First'.
Re: opening a file name with a $ in it
by Anonymous Monk on Feb 03, 2000 at 15:36 UTC
    Stick a \ in front of the $ ie "some\$thing"
      He's already said that escaping the $ doesn't work.
      Single-quotes are the way to go, as dlc says.
Re: opening a file name with a $ in it
by dlc (Acolyte) on Feb 03, 2000 at 02:36 UTC

    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;