Showing posts with label opendir. Show all posts
Showing posts with label opendir. Show all posts

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";
}