I had a different Perl issue on Windows a while back and what I found that helped me might end up helping you out.

In my situation, I was trying to deal with very long paths. In Windows, there are two file system APIs. One of the APIs (used by file explorer and the command prompt) is limited to a max of 250-256 characters (I've seen different reference material with differing values) and that limitation is in place for backwards compatibility. The other API allows for use of the full capabilities of NTFS, which are significantly longer path support as well as Unicode support. Although you might not be hitting the path length issue, the Unicode support may be an issue for your code.

The module that I found that gave access to the second API is Win32::LongPath, which provides replacement functions that uses "Windows wide-character functions which support Unicode and extended-length paths". In your case, you would import Win32::LongPath into your code change your -e $path to be testL ('e', $path) instead. (See the documentation on the testL function for the list of other -x file tests that it can replace.)

Also, if you are dealing with files that have Unicode in the filenames, you may have issues with other file related tasks, such as opening the file for reading/writing or file stat tasks. The Win32::LongPath module probably should have other functions to help provide you with a work around solution.


In reply to Re: Perl on Windows: file names with accented characters, UTF-8 and -e by dasgar
in thread Perl on Windows: file names with accented characters, UTF-8 and -e by bart

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.