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
    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?

Thanks,
Dan


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to