I do not know about perl, but in python I am using
http://dataset.readthedocs.org/en/latest/api.html#dataset.freeze
Dataset also has a "freezefile" script which you could use without
having to program python. Perhaps you can rig up freezefile under a
cron job to dump the csv to a webserver directory?
If you are a bit more enthusiastic, look into getting MySQL triggers to
write out a "/tmp/csv_is_dirty", and write a cgi that handles your
d3.csv which first uses that file to know if it needs to redump the db.
If you are looking for something more responsive (like, AJAX messages
sending everytime a row is added to the db)... well, I'm looking into
that myself at the moment.
I hope this gives you ideas! I am struggling with this very issue.
--
-Nick Guenther
4A Stats/CS
University of Waterloo