my $pattern = qr{se\d{4}ab}i; opendir(DIRHANDLE, ".") or die "Cannot opendir: $!"; my @files = grep { -e and /$pattern/ } readdir DIRHANDLE; unlink for @files;
In reply to Re: Delete files matching pattern
by sh1tn
in thread Delete files matching pattern
by bofh_of_oz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |