in reply to Re: Re: Re: Glob on Win32: porting 5.005 to 5.6
in thread Glob on Win32: porting 5.005 to 5.6
Perl's automagical conversion of / to \ for Win 32 is great.
Mostly FYI, Perl doesn't convert / to \ for Win32. Win32 itself accepts / as a path separator almost everywhere. Even command.exe accepts / as a path separator. But most tools from Microsoft that access file names on their command line don't allow / as a path separator (because they use / to introduce command-line options).
Strangely, "open file" dialogues also don't accept / as a path separator, though I can find no reason why that should be (and this doesn't affect your Perl code unless you are stuffing fake keystrokes into a GUI with Perl, which is how I noticed this).
Also, the Registry doesn't allow / as a key path separator because you can use / as part of a key name. Luckilly, Win32::TieRegistry deals with this rather well so Perl coders don't have to fret about it.
So it is often best to use / as your directory path separator in Perl and convert / to \ if you need to hand the path to an external program on its command line.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: / vs. \ in Win32 (Re: Glob on Win32: porting 5.005 to 5.6)
by tachyon (Chancellor) on Sep 04, 2001 at 19:37 UTC | |
by tye (Sage) on Sep 04, 2001 at 19:46 UTC | |
by tachyon (Chancellor) on Sep 04, 2001 at 19:52 UTC | |
by tye (Sage) on Sep 04, 2001 at 20:20 UTC | |
by tachyon (Chancellor) on Sep 04, 2001 at 20:27 UTC | |
by perchance (Monk) on Sep 05, 2001 at 10:19 UTC |