Got this on a sample update..

Found track in iTunes
Marking as played in iTunes
Win32::OLE(0.1702) error 0x80020005: "Type mismatch"
in PROPERTYPUT "playedDate"

The playcount was updated, but the playedDate ran into this.

I changed your perl script like:

#%%$status = $trackHandle->{playedDate} = "$hr:$min:$sec $day-$monthHash{$month}-$year";
$status = $trackHandle->{playedDate} = "$day-$month-$year $hr:$min:$sec ";

And all was good. Thanks for the commented output lines.. they helped.

Running XP SP2. Latest security patches. Active Perl 5.8