The glob() won't find hidden files on Windows, either. Thus, the concepts are portable. If you need hidden files also, you should use an opendir() approach instead, and this goes for all platforms.

I see the shell hack ".??*" a lot, but it has a nasty bug in there: it ignores directories or files that have names like ".a" or ".3". While this may seem like a rare case, there's a huge difference between making something that will break rarely, and making something that will work completely consistently. Just imagine trying to figure out why that directory didn't get added to a backup tape, and of course, it's too late when you discover this.

Regarding your other comment about filename extensions, Windows FAT always has an extension, even if it is blank. The string "*." is not the same thing as the string "*"; a call to "*." would get all files with no extension (and no visible period) on Windows, while it would get all files which end in period on Un*x.

--
[ e d @ h a l l e y . c c ]


In reply to Re^4: Read a list of files into an array by halley
in thread Read a list of files into an array by monkeybus

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.