Re: Read text files only into a hash

2001-07-27 Thread Michael Fowler
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, perldo

RE: Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
You guys are great! -Original Message- From: Wagner-David [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 4:46 PM To: [EMAIL PROTECTED] Subject: RE: Read text files only into a hash I made the change as $dir_file = "$dir/$file"; next if ( -d

RE: Read text files only into a hash

2001-07-27 Thread Wagner-David
Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 14:13 To: [EMAIL PROTECTED] Subject: RE: Read text files only into a hash It still appears that the -T is also reading the directories in to the hash. the statement below looks logical

RE: Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
-- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:56 PM To: Mooney Christophe-CMOONEY1; [EMAIL PROTECTED] Subject: RE: Read text files only into a hash Sorry -- let me try that again ... Why don't you change your next statement to: next unless -T

RE: Read text files only into a hash

2001-07-27 Thread Mooney Christophe-CMOONEY1
Sorry -- let me try that again ... Why don't you change your next statement to: next unless -T "$dir/$file" || /^\./; -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTECTED] Subject: Read text fi

RE: Read text files only into a hash

2001-07-27 Thread Mooney Christophe-CMOONEY1
Why don't you change your next 'next unless -T "$dir/$file"'; That will skip over any non-text files, including dirs and '.' -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTE

Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
All, I am trying to read only text files (using the -T test) from a directory into a hash, and not directories themselves. How do I prevent it from it reading in directories? This sounds like a basic question and know there is probably an easy answer... but I can't think of it. Thanks. @ARG