Hi Roboticus, thanks for the snippet. i re-wrote the code adding your added variables, and it seems to be working now, but also worked with my original code now. i'm not sure why. I can get this to print out the date's in the format i want with "$info->{$_}" but starting on line 73 where i want to use that date output, is where it fails. with this error.
prefix TUMI style 1174451041 view tag 1174451041 was created Use of uninitialized value $_ in hash element at /var/folders/ty/jy84g +mxs4f7c_n0bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled text.pl line + 73. Use of uninitialized value in string at /var/folders/ty/jy84gmxs4f7c_n +0bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled text.pl line 73. Use of uninitialized value $_ in hash element at /var/folders/ty/jy84g +mxs4f7c_n0bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled text.pl line + 79. Use of uninitialized value in mkdir at /var/folders/ty/jy84gmxs4f7c_n0 +bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled text.pl line 79. Use of uninitialized value $_ in hash element at /var/folders/ty/jy84g +mxs4f7c_n0bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled text.pl line + 80. Use of uninitialized value in scalar assignment at /System/Library/Per +l/5.18/File/Copy.pm line 110. Use of uninitialized value $to in string eq at /System/Library/Perl/5. +18/File/Copy.pm line 102. Use of uninitialized value $to in -d at /System/Library/Perl/5.18/File +/Copy.pm line 134. Use of uninitialized value $to in stat at /System/Library/Perl/5.18/Fi +le/Copy.pm line 142. Use of uninitialized value $to in open at /System/Library/Perl/5.18/Fi +le/Copy.pm line 234. Use of uninitialized value $_ in hash element at /var/folders/ty/jy84g +mxs4f7c_n0bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled text.pl line + 80. Use of uninitialized value in concatenation (.) or string at /var/fold +ers/ty/jy84gmxs4f7c_n0bhfhvs6t40000gq/T/TextWranglerRunTemp-untitled +text.pl line 80.
#!/usr/bin/perl -w use Net::FTP; use File::Copy; use File::Basename; use POSIX qw(strftime); BEGIN { unshift @INC, '/usr/bin/lib' } use Image::ExifTool 'ImageInfo'; print "#################################\n"; print "#################################\n"; print "#################################\n"; print "#################################\n"; print "#################################\n"; my $sort = "/Users/flieckb/Desktop/psds/"; my $wpf = "/Users/flieckb/Desktop/sort/"; chdir( $sort ) or warn "Cant chdir to $sort $!"; my(@sort_list) = glob "*.psd"; my $sortlist = @sort_list; my $prefix; my $style; my $view; my $exifTool = new Image::ExifTool; foreach my $file (@sort_list){ my @tags = qw(DateTimeOriginal); $exifTool->Options(Duplicates => 0, DateFormat => '%m-%d-%Y'); my $info = $exifTool->ImageInfo($file, \@tags); foreach (@tags) { print "$info->{$_}\t"; } print "\n"; # # foreach (@tags) { # if (! exists $info->{$_}) { # print "file $file doesn't have tag $_\n"; # } # elsif (! defined $info->{$_}) { # print "file $file has tag $_, but it has no value\n"; # } # else { # print "$info->{$_}\n"; # } # if ($file =~qr/\A([^_]+)-([^_]+)(?:_([^_]+))?\.([^\.]+)\z/) { # $prefix = $1; # $style = $2; # $view = $3; # # print "prefix $prefix\n"; # print "style $style\n"; # print "view $view\n"; # # my $movelist = "$sort$file"; # if (-d "$style") { # chdir ($style) and print "$style already exsits\n"; # } # else # { # mkdir($style, 0777)and print "$style was created\n"; # chdir ($style); # } # ## # if (-d "$info->{$_}") { # print "$info->{$_} already exsits\n"; # copy ($movelist, $info->{$_})or warn print "Copy $info->{$_} Failed: + $!\n"; # } # else # { # mkdir($info->{$_}, 0777); # copy ($movelist, $info->{$_})or warn print "Copy $info->{$_} Failed: + $!\n"; # } # chdir ($wpf); # } # else # { # print "did not match expression = $file\n"; # }; } # }

In reply to Re^2: date created in exiftool by flieckster
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.