Dan Jablonsky wrote: > Hi all, > I am trying to read only files in a directory; I need > to jump over the dot files and any subdirectories. > Seems like a simple thing, however with > > opendir(DIR, $dir) || die "can't opendir $dir: $!"; > foreach my $file (readdir DIR) > { > next if (/^\./); # skip over dot files
next if "$dir/$file" =~ (/^\./); or just do them both with : next if -d "$dir/$file"; > print "file name is: $file\n"; > } > > I get . and .. and all subdirectories. > > with > > opendir(DIR, $dir) || die "can't opendir $dir: $!"; > foreach my $file (readdir DIR) > { > next if -d $file); # skip over directories > print "file name is: $file\n"; > } > > I skip the dot files but I still get the > subdirectories. Any idea how do I get only the plain > files? _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs