what about skipping the directory entries?
my $dir = '/Path/to/a/data/directory'; opendir my $DH, $dir or die "Cannot open '$dir' $!"; my %hash; while ( my $file = readdir $DH ) { next if $file =~ /~$/; next if -d "$dir/$file"; # should also skip +'.' and '..' entries # read and process file }
update: fix path issue "$dir/$file"
In reply to Re^2: greater efficiency required (ls, glob, or readdir?)
by linuxer
in thread greater efficiency required (ls, glob, or readdir?)
by jperlq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |