This script reads digital photos downloaded from a digital camera and appends date and time to filename.
It finds a date and time pattern from the begining of the jpg file for example. The date and time are not from the file access time. It is embeded in the file. So even if you copy the file, it wouldn't matter. I found that it can also handle AVI files.
Run the script with a file or list of files. scriptname.pl file1.jpg file2.avi file3.JPG file4.AVI
file1.jpg becomes file1_2006-11-12_17_41_17.jpg
The format is <filename>_<yyyy>-<mm>-<dd>_<hh>_<mm>_<ss>.<ext>
I've tested the script on a Nikon 5700 and Fuji E900. Both with JPG and AVI files.