Thanks for the suggestion Ollie. You helped me find the solution to the problem. I didn't use Image::MetaData::JPEG but I did use one similar to it, Image::ExifTool::Exif. Your suggestion got me looking for the right thing though thanks. I downloaded the module from CPAN, then I was able to do what I set out to accomplish. Heres the code I wrote for anyone that is interested:

#!/usr/local/bin/perl # # PicRenamer.pl # script to rename pics and videos based on the date # in the following format "YYYY-MM-DD_HHmmSS_Event.JPG" # # Written by: odog502 # backup all your files before trying this!!! Im not responsible # for any missuse of this script # $dir = 0; $event; $property; $filetype; print 'Enter location of files to be renamed (ex. C:/test): '; chomp($dir = <STDIN>); print 'Enter the name of event that describes these pictures(no sp +aces): '; chomp($event = <STDIN>); print 'Enter the exif property that contains the date(eg Date/Time + Original): '; chomp($property = <STDIN>); # examples "File Modification Date/Time", "Create Date", "Date/Tim +e Original" print 'Enter the extension of the filetype you want modify(e.g. \' +jpg\'): '; chomp($filetype = <STDIN>); chdir ("$dir"); # # gets appropriate files and sorts them by file name # @files = <*.$filetype>; @files = sort {$a cmp $b} @files; # # Go through each filename and use exif to get its properties. # Loop through each property until you find the one with the date # Rename the file to the date found in the property, add the custom # "event" name to the end. # $i = 0; until ($i > $#files) { print "working on file: $i $files[$i]\n"; open (FILEPROP, "C:\\Image-ExifTool-8.00\\exiftool.pl \"$dir\\ +$files[$i]\" |") or die $!; while (<FILEPROP>){ chomp; if ( $_ =~ /$property\s*: (\d{4}):(\d{2}):(\d{2}) (\d{2}): +(\d{2}):(\d{2})/){ print "Changing to: $1-$2-$3_$4$5$6_$event.$filetype\n +"; rename "$files[$i]", "$1-$2-$3_$4$5$6_$event.$filetype +"; } $j++; } close FILEPROP; $i++; }

In reply to Re^2: Getting file attributes/properties using Win32 OLE by odog502
in thread Getting file attributes/properties using Win32 OLE by odog502

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.