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";
# };
};