I’m trying to open a file with path contains space, say:
open(FILE, "some\\path with spaces")
I’m working with ccperl on Windows, and I get an error “can’t open file”.
I’ve already tried q!"..."! tried "\path\ with\ spaces" and many more…
Any idea?
Let’s see. On my ActivePerl 5.14.2 I can do the following, which works:
The difference to what you’ve done is that I used single quotes
'. Inside them, the backslash\is not seen as a meta character, so there’s no need to escape it. You also do not need to escape the spaces. You should try that out.On a side note, are you using
strictandwarnings? They might tell you what is wrong, as well as myor die $!might.I’d also suggest you use the three argument form of
openand lexical filehandles.