Open filename with special characters in Perl

Hi All,
I am facing a weird problem. I have got a directory structure copied from windows to Linux. Some of the folders are named like

/gfs/data/Dow Jones $5/ DJ FCBOT_O_tick_1998.zip
/gfs/data/Dow Jones $5/ DJ FCBOT_O_tick_2000.CSV
/gfs/data/Dow Jones $5/SomeTextHere$10Futures_8811_27484684-fc45-4933-b359-88105a0d984d.CSV

I am able to read the above two lines, no problem. But, while reading the third file it gives me error: no such file and directory found.

Please suggest some good solution.

Thanks in anticipation.

Shatru.

Somebody please provide me with a solution asap, its urgent.

Thanks.

try tu use "file_name"

Can you see the file listed in the directory if you go to it? Are you hard coding the filenames in your perl script? Did you use double-quotes when you should have used single-quotes? Post the relevent perl code that causes the error and answer the above questions.

use backslash in front of the $

/gfs/data/Dow Jones $5/SomeTextHere$10Futures_8811_27484684-fc45-4933-b359-88105a0d984d.CSV 
ls /gfs/data/Dow Jones \$5/SomeTextHere\$10Futures_8811_27484684-fc45-4933-b359-88105a0d984d.CSV 

You're stucture and file names are really not recommended for UNIX; you'd be much better off, removing blanks, in files/dir's, and not using special charachters.

It works for me. Which kind of filesystem are you writing to? Unix-based? FAT/NTFS? or Samba shares?

# mkdir 'Dow Jones $5'
# ls
Dow Jones $5
# touch 'Dow Jones $5/Hello.txt'
# perl -e 'open(LOG, q|>>Dow Jones $5/Hello.txt|) or die $!; print LOG "This is a test\n"'
# cat Dow\ Jones\ \$5/Hello.txt
This is a test

It works becuase you have properly used a single-quoted string (q||) but it will not work if you use double-quote or qq||. Hopefully the person comes back and reads this thread.