Hi there, i have a 2 part question. 1, is this code, which is simply going to a known folder of .psd files reading them, and then using exiftool to pull the 'dateTimeOrginal' from the file. when i run this script as is, i get "Use of uninitialized value in concatenation (.) or string at /Users/flieckb/Desktop/StlyeSorterTUMI v2.pl line 42." for some reason this set up seems to work sometimes, and other times it doesn't, but i can't see to figure out why. once that part is set up i'd like to use that date in the commented out script below replacing $date with the exiftool 'DateTimeOriginal' date, but i can't seem to print out the "info->$_" later in the script.
#!/usr/bin/perl -w use Net::FTP; use File::Copy; use File::Basename; use POSIX qw(strftime); use Image::ExifTool 'ImageInfo'; print "#################################\n"; print "#################################\n"; print "#################################\n"; print "#################################\n"; print "#################################\n"; my $sort = "/Users/flieckb/Desktop/psds/"; my $wpf = "/Volumes/photorepos/Weekly_Product_Folders/Tumi/"; my $current = `date +%m/%d/%Y`; chomp $current; chdir( $sort ) or warn "Cant chdir to $sort $!"; my(@sort_list) = glob "*.psd"; my $sortlist = @sort_list; my $exifTool = new Image::ExifTool; chdir ($wpf) or warn "Cant chdir to $wpf $!"; foreach my $file (@sort_list){ my $prefix; my $style; my $view; my @tags = qw(DateTimeOriginal); $exifTool->Options(Duplicates => 0, DateFormat => '%m-%d-%Y'); my $info = $exifTool->ImageInfo($file, \@tags); print "$file\t"; foreach (@tags) { print "$info->{$_}\t"; } print "\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 "$date") { # print "$date already exsits\n"; # copy ($movelist, $date)or warn print "Copy $date Failed: $!\n"; # } # else # { # mkdir($date, 0777); # copy ($movelist, $date)or warn print "Copy $date Failed: $!\n"; # } # chdir ($wpf); # } # else # { # print "did not match expression = $file\n"; # }; };

In reply to 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.