this is not really a perl question, though one could do this in perl fairly easily* with a module like
DBI I 've had to do this a number of times, i'd say the best easiest most flexible program that does this is
PhpMyAdmin which requires php 3 or 4 and a webserver. Not only does PhpMyAdmin allow a flexible set of options for CSV export, but it also allow you to export SQL or PHP code to recreate your database.
*I say fairly easily but there are a number of gotchas involving dealing with data containg quotation marks and/or commas. There are functions in DBI that will make quoting these strings a bit easier.