On Fri, Jul 27, 2001 at 04:13:08PM -0500, Shepard, Gregory R wrote:
> It still appears that the -T is also reading the directories in to the hash.
> the statement below looks logical. Is there a test to specifically exclude
> directories?
There is a test to check if a file is a directory, perldoc -f -X. -T does
not evaluate to true on directories, though, so you don't need such a test.
> while ($file = readdir DIR)
> {
> next unless -T "$dir/$file" || ~/^\./;
This should probably be:
next unless -T "$dir/$file" && !/^\./;
Which would exclude anything that isn't a text file, and anything that
starts with a period, though I'm not entirely sure you actually want to
exclude files starting with period.
> $dir_file = "$dir/$file" if -T "$dir/$file";
This second -T test is redundant.
> @filespecs = stat("$dir_file");
> $filespecs = $filespecs[9].$time_num;
> $time_table{"$filespecs"} = "$file";
> $time_num++;
This seems very odd. You're concatenating onto a number (which is usually
wrong), and you're accessing a variable that I don't see initialized
anywhere, $dir_file. You do have warnings and strict turned on, right?
> }
What is it you're trying to accomplish with this?
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]