!/usr/bin/perl use strict; use warnings; chomp(my $dir = <STDIN>); if (-d $dir){ opendir ($DIR, $dir); @files = grep {/^(?!\.{1,2}\z)/} readdir($DIR)); closedir($DIR); } foreach $file (@files) { print "$file\n"; }
In reply to selcting all files in a given directory except...... by asdfghjkl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |