If this is a long running perl program then you are probably getting a "MySQL server has gone away" error issue. The DBH will time out after 8 hours (by default). You either do a transparent reconnection or potentially up the timout in /etc/my.cnf. I have seen the PHP guys advocate upping the time out as a fix (bad solution generally) but be aware you will run out of connections unless you close them on exit...
[root@devel3 james]# cat /etc/my.cnf
[client]
socket=/var/lib/mysql/mysql.sock
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#set-variable=wait_timeout=3600 <----------
set-variable=max_connections=40
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[root@devel3 james]#