In my OS, any character ASCII > 0 and ASCII < 128 are valid characters to use in a file or directory name. However, Perl's -d operator seems to be balking at this. It's mkdir command handles it well enough, though.

I get this error:

Unsuccessful stat on filename containing newline at MyModule.pm line 2 +10.
Here is all I'm doing:
next if -d "$dir/$current_filename";
I don't see any advice in Q&A files or Q&A directories. Perldoc -X doesn't specify what might be the problem, and my searches aren't turning up anything, either.

Is there some way to tell Perl's -d function, "It's OK. Nevermind the newline, already! My OS, he likes it, all right?"


In reply to Perl stricter than my OS regarding file/dir names by jffry

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.