010011510005801_0669_main.psd 010011510005801_0964_main.psd 010011520006618_0964_main.psd 010011520006618_5030_main.psd 010011520006812_0670_main.psd 010011520006812_0990_main.psd #### /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/4/010011510005801_0669_main.psd /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/4/010011520006618_5030_main.psd /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/4/010011520006812_0670_main.psd /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/9/010011510005801_0964_main.psd /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/9/010011520006618_0964_main.psd /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/9/010011520006812_0990_main.psd #### 010011510005801_0669_main.psd /Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/4/010011510005801/Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/4/010011520006618/Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/4/010011520006812/Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/9/010011510005801/Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/9/010011520006618/Volumes/photorepos/Partners/Christopher_Banks/post/CB_instock/9/010011520006812_0990_main.psd #### #!/usr/bin/env perl -w use File::Find; use File::Copy; use File::Basename; use File::Basename; use File::Slurp; use POSIX qw(strftime); my $date = strftime("%m-%d-%y",localtime); my $time = strftime("%I:%M:%S",localtime); my $findme = "/Volumes/photorepos/Perl/SLAperlDropback/"; my $file_loc = $findme. '2SLAday'; my $filenames_to_putback = '/Volumes/photorepos/Perl/SLAperlDropback/dropback.txt'; chdir($file_loc) or warn "$!"; @filesforeach = glob "*.*"; my $filecount = @filesforeach; print "$filecount\n"; chomp @filesforeach; 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
"; move($_,$row) or warn "shit went wrong yo! $!\n"; } } } } # print "@output\n";