http://qs321.pair.com?node_id=24101

rauschy33 has asked for the wisdom of the Perl Monks concerning the following question:

thank you for those who responded; Here is the code that I have been working with:
$dir= shift || '.'; opendir DIR, $dir or die "Can't open directory $dir: $!\n"; while ($file= readdir DIR ) { next if $file !~/^\w{10,}\d{4,}\.\d{1,}/; print "Found a file: $file\n" if $file=~/^\w{10,}\d{4,}\.\d{1,}/; } print "are you sure that you want to delete $file 'Y/y(es)' "; chop ($answer = <STDIN>); unlink $file or die "Can't delete $file: $!\n" if $answer =~m%^Y(es)?$ +%i;