I would like to delete the files found if they match what was found above in the database call. Can anybody tell how I could do that? Thanks for the help!... while (my $row = $sth->fetchrow_hashref()) { my $del_1 = $row->{image_1} || ''; my $del_2 = $row->{image_2} || ''; my $del_3 = $row->{image_3} || ''; my $del_4 = $row->{image_4} || ''; } my $dir_to_open = "../../pics"; opendir(DIR,$dir_to_open) || die("Cannot open directory !\n"); @dir_contents= readdir(DIR); closedir(DIR); foreach $file (@dir_contents){ if(!(($file eq ".") || ($file eq ".."))){ # I want to delete the files found in here if they match what was fou +nd above in the database call } }
In reply to Delete files if they match help! by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |