Jun 22, 2008

How to get all files in a directory

#!F:\Perl\bin\perl -w
use strict;

opendir(DIR, ".");
my @files = readdir(DIR);
closedir(DIR);
foreach my $file (@files) {
print "$file\n";
}

No comments:

Post a Comment