Keep It Simple, Stupid | |
PerlMonks |
Re^2: file open with variablesby afoken (Chancellor) |
on Sep 27, 2022 at 17:15 UTC ( [id://11147137]=note: print w/replies, xml ) | Need Help?? |
a backslash is special in double quotes, so it needs to be backslashed to keep its literal meaning. In this special case, a DOS-style path on Windows not passed to legacy applications, using forward slashes instead of backslashes also works and is slightly more readable:
(Explaining the forward slashes: The entire Windows API accepts both forward slashes and backslashes, and so did DOS. Only a few legacy commands use forward slashes to introduce switch parameters. Perl does not care at all about forward slashes or backslashes in path names, it just passses the path name to the underlying operating system. See Re^2: What is the meaning of this line in Perl on linux? and the links in that subthread for more details.) Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|