#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; use File::Find::Rule qw/ find /; use autodie; use Digest::MD5 qw( md5_hex ); my $qphotoreclog = 'qphotorec.log'; $qphotoreclog = path( $qphotoreclog )->realpath; chdir path( $qphotoreclog )->parent; my $notit = ''; for my $unwanted ( find( file => maxdepth => 1 , in => 'D:/' ) ){ next if not -T $unwanted; $notit.=path( $unwanted )->slurp_raw; } my @files = sort glob 'myfinalfiles/*'; my @maybeit; my @notit; for my $file ( @files ){ my $isit = path( $file )->slurp_raw; if( $notit =~ /\Q$isit\E/ ){ push @notit, $file; } else { push @maybeit, $file; } } dd( 'notit', @notit ); dd( 'maybeit', @maybeit ); dd( 'files', int @files ); dd( 'notit', int @notit ); dd( 'maybeit', int @maybeit ); path('myfinalmaybeit')->mkpath; for my $file ( @maybeit ){ path( $file )->copy( 'myfinalmaybeit/'); } __END__ ... ("files", 6341) ("notit", 4294) ("maybeit", 2047) 18M myfinalmaybeit