Use opendir and readdir to read all file names from a directory:
opendir my $DH, $dir or die "Cannot open '$dir' $!"; while ( my $file = readdir $DH ) { if ( -f "$dir/$file" && $file =~ /^\.DS_Store/i ) { print "$file\n"; unlink "$dir/$file" or warn "Cannot delete '$dir/$file' $!"; } }
In reply to Re: View hidden files?
by jwkrahn
in thread View hidden files?
by sito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |