Hail thee!

I haven't coded Perl for Win32 for quite a time now (mostly work on Solaris), therefore, I tend to run into weird problems with common modules and scripts that used to work on Solaris and won't work well (or as expected) on Win32 systems.

One particular problem I have is with File::Find using '/' in file path names, instead of, say, '\' as I thought it would do. Doesn't File::Find do a check on the type of system it is dealing with and then figure out which 'slash' is to be used? I now end up having to do 's/\//\\/g' on my file path to switch all '/' to '\' so that I can actually access those files.

Here's a small snippet from my code:
find(sub { !/$skip_match/ && /$accept_match/ && -f && $handle_onfound->("$File::Find::name", $handle_on +found_args); }, $startdir);
where, $handle_onfound is a handler subroutine and $startdir is set to directory I wish to do my search in. $File::Find::name would always have '/' in it. I'm wondering if any monk out there would know of a way to fix this? I consulted File::Find perldoc but didn't find anything pertaining to this matter.

Thanks for help! ;)

"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith

In reply to File::Find uses '/' in path on Win32 system. by vladb

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.