Hello.
I'm not very familiar with perl, or exif, but recently I've had some problems modifying the exif data contained in jpegs which were written by various Apple products, including Aperture ( more accurately the programs which I use, which were written by other people, which use this library have been having these problems).
At some point in time, Apple changed things so that Aperture now produces jpegs like:
http://www.ugcs.caltech.edu/~davinm/exiftool/bad.jpg
Opening it and saving as a jpeg in photoshop cs2 produces:
http://www.ugcs.caltech.edu/~davinm/exiftool/good.jpg
(4)
]
