in reply to File Not Found in Attempt To Unlink
It's a little hard to see the problem because I don't know your system, but here are a few things to try:
This creates an regex pattern that is an alternation of all your search terms, each of which has potential regex meta characters escaped. Of course, this may not be want you want if the search terms are regex patterns themselves. In that case, remove the map clause.my $pattern = join '|', map{"\Q$_\E"}@search_terms; while(my $suspect = <FTS>){ chomp($suspect); if( $suspect =~ /$pattern/o ){ push @delete_me, "$base_path$term"; } }
foreach (@file_list){ # don't bother putting $_ here print $_, '<br>'; }
Hopefully in some of this message, you'll find the key to unlocking this thorny problem. Good luck!
--jjohn
|
|---|