Poor clock accuracy of UNO

tim7:
Perl's timing appears to be very precise...

I suspect that's nothing to do with Perl but if you're happy with that then why not get Perl to send time data to the Arduino so it can compensate for the inaccuracies of the crystal?