in reply to How do I open a file in a path that has spaces in the name?

The spaces are not the problem.
Okay, first:
use strict; use warnings;
Second:
If you are going to use double quotes, then you will need to use double backslashes or slashes. If you change the double quotes to single quotes all will be well. Example:
#!/usr/bin/perl # ^ that should work for most Win32 installs use strict; use warnings; my $filename = "c:\\Program Files\\My Projects\\Scripts For Oracle\\te +st1.txt"; test_file($filename); $filename = "c:/Program Files/My Projects/Scripts For Oracle/test2.txt +"; test_file($filename); $filename = 'c:\Program Files\My Projects\Scripts For Oracle\test3.txt +'; test_file($filename); sub test_file { my $filename = shift; open(FILE, "> $filename") || die "Could not open the file $filename +for writing at "; print FILE "testing\n"; close(FILE); }
I hope that I have made this clear enough.

Originally posted as a Categorized Answer.