in reply to Read from directory list...
Most of the time, I tend to prefer glob to opendir followed by readdir, but that's mostly stylistic.
For glob, you would do something vaguely like:
my @list = glob('*');
I believe glob ignores hidden files (on *ix, files with names starting with "."), while readdir doesn't. With readdir, you'll always get at least two files, as . (the directory itself) and .. (its parent) will (almost) always show up (offhand, I don't know if .. will show up for the root directory on *ix), so you'll have to handle these if you're going to recurse through a directory tree, a la find.
emc
Insisting on perfect safety is for people who don't have the balls to live in the real world.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read from directory list...
by klekker (Pilgrim) on Feb 06, 2007 at 20:35 UTC |