If you're hosted on a Linux box you can do this using a cron job.
I don't program in Perl anymore (I use PHP) but the concert is still the same: code a script to do what you want to the database and put it in a cron job to run when ever you want.
Using Perl or PHP you can automate what ever you want - just write the script and then let cron exceute it for your automatically. You can tell cron exactly when to run your script!