Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Read a list of files into an array

by halley (Prior)
on Jun 25, 2007 at 12:49 UTC ( [id://623165]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Read a list of files into an array
in thread Read a list of files into an array

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 ]

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://623165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-29 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found