RE: Question about traversing dirs as well

2002-06-24 Thread Timothy Johnson
He's right. The reason why it isn't catching the "dot" directories is because the negative match operator is !~, not !. -Original Message- From: Harry Putnam [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 22, 2002 7:47 AM To: [EMAIL PROTECTED] Subject: Re: Quest

Re: Question about traversing dirs as well

2002-06-22 Thread drieux
On Saturday, June 22, 2002, at 05:28 , Erik Riggenbach wrote: > so here's my code and the problem is that it doesn't a) ignore the . and > .. > dirs b) it doesn't acknowledge some dirs as being dirs. [..] > readmydirs('/mp3'); > > sub readmydirs{ >opendir(DIR, $_[0]); >my @lists = readd

Re: Question about traversing dirs as well

2002-06-22 Thread Harry Putnam
Harry Putnam <[EMAIL PROTECTED]> writes: >> readmydirs('/mp3'); >> >> sub readmydirs{ >>opendir(DIR, $_[0]); >>my @lists = readdir DIR; >>foreach my $element (@lists){ > > Maybe you need an explicit match here: > >> if(-d $element and !/^\.{1,2}$/){ >if(-d $element and $

Re: Question about traversing dirs as well

2002-06-22 Thread Harry Putnam
"Erik Riggenbach" <[EMAIL PROTECTED]> writes: > so here's my code and the problem is that it doesn't a) ignore the . and .. > dirs b) it doesn't acknowledge some dirs as being dirs. With some examples > where there are lots of files and Dirs it does print the '-' before the > dirs. Needless to

Question about traversing dirs as well

2002-06-22 Thread Erik Riggenbach
so here's my code and the problem is that it doesn't a) ignore the . and .. dirs b) it doesn't acknowledge some dirs as being dirs. With some examples where there are lots of files and Dirs it does print the '-' before the dirs. Needless to say, if the recursion is not commented out it's an infi