#Reading files from the Directory
my $dir = 'C:\Users\philip\Desktop\sample_files';
opendir(DIR, $dir) or die $!;
while (my $file = readdir(DIR)) {
# Use a regular expression to ignore files beginning with a period
next if ($file =~ m/^\./);
print "$file\n";
}
closedir(DIR);
my $dir = 'C:\Users\philip\Desktop\sample_files';
opendir(DIR, $dir) or die $!;
while (my $file = readdir(DIR)) {
# Use a regular expression to ignore files beginning with a period
next if ($file =~ m/^\./);
print "$file\n";
}
closedir(DIR);
No comments:
Post a Comment