Perhaps you should use File::Find instead. It doesn't look you are capturing the File's name....C:\>perl -w rauschcode.pl C:\WINNT\temp Use of uninitialized value in concatenation (.) at rauschcode.pl line +10. are you sure that you want to delete 'Y/y(es)' y Use of uninitialized value in unlink at rauschcode.pl line 13, <STDIN> + line 1. Use of uninitialized value in concatenation (.) at rauschcode.pl line +13, <STDIN> line 1. Can't delete : Bad file descriptor
Of course, this could be made much better by adding some error checking, etc, but this seems to work just fine! :) HTH.use File::Find; find(\&wanted, (shift || '.')); sub wanted { my $filename = $File::Find::name; print "Delete $filename? (Y/n)"; my $answer = (<STDIN>); unlink $filename if $answer =~m%^Y(es)?$%i; }
In reply to Buzzcutbuddha: Re: Code for DELETING NT FILES
by buzzcutbuddha
in thread Code for DELETING NT FILES
by rauschy33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |