http://qs321.pair.com?node_id=11120080

Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:

All,
I am looking for a little help with a File::Find::Rule and Image::ExifTool script. My environment is Windows but I only have Perl available via Cygwin. I have a bunch of hard drives in this machine collected over the years so a manual search has proven to be untenable.

I haven't really coded in years so while this once seemed like a trivial task, I am having issues getting the expected results.

#!/usr/bin/perl use strict; use warnings; use File::Find::Rule; use Image::ExifTool qw(:Public); my $tool = Image::ExifTool->new(); for my $file (File::Find::Rule->file()->name( qr/\.(jpeg|jpg)$/i)->in( +'/')) { my $info = ImageInfo($file, 'DateTimeOriginal'); my $date = $info->{DateTimeOriginal}; next if ! $date || $date !~ /^2015/; print "$file\t$date\n"; }

When I tried it in my home directory as a test, it did exactly what I expected but when I changed '.' to '/' it started generating every file on the system (directories, text files, etc.) without the date.

Cheers - L~R