$pic =~ s/^(\d+).*/$1/; $h++; $uniquelist{$pic}++; next if ($currentlist{$pic}); $deletelist{$pic}++;