...with respect to the use of forward slashes in windows -- M$ sees the two as equivalent...
To be more precise, the Windows API treats forward slashes and back slashes equivalently in file path arguments to all Windows API functions. However, Windows commands typically use forward slash for command line argument options.

So, while using forward slashes in file paths is fine when calling Win32 API functions (as the perl C sources do when built for Windows), using them in command line arguments when running Windows commands can be problematic.

In my Perl programs on Windows, I use forward slashes in all file paths, which works fine when calling all Perl internal functions. In the rare cases where I need to pass a file path to an external Windows command, I translate it like so: $filepath =~ tr{/}{\\};

See also: forward vs back slash python question.

Update: Note that all Win32 API functions have always treated forward slashes and back slashes equivalently in file path arguments. See also Re^2: What is the meaning of this line in Perl on linux? and Re^4: Changing filename extensions.


In reply to Re^4: windows perl and paths by eyepopslikeamosquito
in thread windows perl and paths by flieckster

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.