in reply to glob a folder of images, and open text doc, find the matches and move the images.

Your code is completely absent any meaningful indenting.
} } } }
Is not good programming style. There are number of acceptable indenting methods, I show one of them below. Every closing "curly brace" should be easy to match up with the opening "curly brace". I did not modify your code, but just added whitespace for clarity. (oops, I think you did miss one curly brace) Believe it or not, whitespace is some of most important "code" that you can write.
foreach $file (@filesforeach) { print "$file\n"; open(my $fh, "<", "$filenames_to_putback") or warn "$!\n"; while (my $row = <$fh>) { chomp $row; print "$row\n"; my @line = $file; for (@line) { if ($_ =~ /$row/) { chomp $_; # push @output, "found $_ that matched redo $file $row <br +>"; move($_,$row) or warn "shit went wrong yo! $!\n"; } } } } # print "@output\n";
All of the "warn" messages should be "die". "warn" just prints a message and continues. warn "$!\n" You probably don't know this but adding the explicit "\n" suppresses the Perl line number of the error. Don't add the "\n" unless you understand what it does. There are uses for this when dealing with unsophisticated users, but in general leave Perl "line of error" reporting on.