After you fix the problem with attempting to remove the directory '.' the next likely problem with this code is the file test -d.
sub unwanted { if(-d $dir) { if ( ( -M $_ ) >2 &&(-M $_)<4)
$dir is a directory so this will return true even when $_ is a file. Try the following instead of if(-d $dir):
return unless -d;This will test $_.
In reply to Re: Can't remove directory-Permission denied
by Lotus1
in thread Can't remove directory-Permission denied
by rrrrr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |