There's an awful lot in your script which doesn't need to be there. Here's a stripped down version with none of the unnecessary modules, no commented-out code, indented loops and no BEGIN blocks. Oh, and it has strict as should every script you ever write.

#!/usr/bin/env perl use strict; use warnings; use Image::ExifTool 'ImageInfo'; print "#################################\n"; my $sort = "/tmp/"; chdir $sort or die "Cant chdir to $sort $!"; my @sort_list = glob "*.jpeg"; my $exifTool = Image::ExifTool->new; my @tags = qw(DateTimeOriginal); foreach my $file (@sort_list) { $exifTool->Options(Duplicates => 0, DateFormat => '%m-%d-%Y'); my $info = $exifTool->ImageInfo($file, \@tags); foreach (@tags) { print "$file $_: $info->{$_}\t" if exists $info->{$_}; } print "\n"; }

This works fine for a collection of jpegs I've put in /tmp for testing (I have no use for .psd files). It produces no errors and no warnings and a nice list of original dates in day-in-the-middle format (your choice, not mine).


In reply to Re^3: date created in exiftool by hippo
in thread date created in exiftool by flieckster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.