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")

In reply to / vs. \ in Win32 (Re: Glob on Win32: porting 5.005 to 5.6) by tye
in thread Glob on Win32: porting 5.005 to 5.6 by perchance

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.