in reply to The Evil Embedded Space

Despite your intent to focus on just embedded spaces in file and path names, I'm compelled to point out that the problem is not just with spaces.

Microsoft also "supports" (in the sense of making it easy for various windows-based GUI tools to use) characters like ampersand, exclamation mark and semicolon. I'm not sure (I'm not a windows user), but it wouldn't surprise me if people could put asterisk, question mark, vertical bar and angle-bracket characters in file or directory names, as well. And every now and then someone can manage to get an oddball control character into a file name.

That kind of stuff can cause real havoc for unsuspecting shell-based operations. Luckily, most modern unix-like shells that have been ported to windows have the feature of automatically inserting back-slash escapes for the nasty characters when doing tab-completion of file names.

But that only applies to interactive shell usage, not sub-shells invoked by "make", etc. The multi-arg usage on system and pipeline open calls makes things somewhat easier when you get to the point of writing perl scripts, but as for handling installation of Perl (and of various CPAN modules), it can be risky business if you have funny characters in path names.

If PodMaster's patch works for things other than space, then maybe the issue is solved. Personally, I'd follow the advice as quoted in the OP: avoid putting perl in a path that is likely to cause a lot of grief for shell usage. There's just no good reason to ask for that kind of trouble.

Replies are listed 'Best First'.
Re^2: The Evil Embedded Space
by Nkuvu (Priest) on May 30, 2005 at 15:34 UTC
    I'm not sure (I'm not a windows user), but it wouldn't surprise me if people could put asterisk, question mark, vertical bar and angle-bracket characters in file or directory names, as well.
    Actually you can't use any of the following characters in a Windows filename:
    \ / : * ? " < > |
    (using the Windows Explorer interface, anyway)

    From the command line, Windows ignores special characters in a file name for some operations, and provides a strange error otherwise. For example, if I use the copy con foo*bar command, I'll end up with a file named foobar. But if I try using the ren foobar ba*z I get a filename with a seemingly random alphanumeric value. In my first trial run I got a file named "baoz", the second time it was "baqz". Windows provides an error anytime I use a : in the filename ("A duplicate file exists, or the file cannot be found" even in an otherwise empty directory).

    All in all I wouldn't be surprised to see oddball characters in any file name, no matter which OS you're using. But it seems some OSs are more prone than others.

      The : character is an indicator that you have an alternate data stream in that file. The : has special meaning, therefore it exhibits odd behavior when used incorrectly.

      --MidLifeXis