use warnings; use strict; use File::Find::Rule; use Image::ExifTool qw(:Public); my $dir = '~/Desktop'; my @files; if (-d $dir){ @files = File::Find::Rule->file() ->name('*.jpg', '*.jpeg') ->in($dir); } else { die "that's not a directory dude!\n"; } my $exif_tool = Image::ExifTool->new; for my $img (@files){ $exif_tool->ExtractInfo($img); # do other stuff with exif tool }