in reply to Unlinking...
or#!/usr/bin/perl -w opendir(DIR, "../test") or die "Can't open ../test: $!"; my @f = readdir DIR; @f = map { unlink $_; $_ } grep { /\.txt$/i } @f;
Both of them return the deleted file names in the @f array.my @f = <*.txt>; @f = map { unlink $_; $_ } grep { /\.txt$/i } @f;
|
|---|