(Note that it is not a good idea to give out your Lunarpages account name (what you called "serverprefix"), as if someone can find your user name and password, they will have unlimited access to your database. However, at this point, that's water under the bridge.)
Are you able to use this database from other languages or applications? That would indicate that you have the right database host, username, password, etc., and it's something peculiar to your use of Perl that's the problem. Note that the "hostname" is your database host (lpsql03.lunariffic.com), not the site host. Everything looks OK in the code you gave, although I haven't used Perl + MySQL on Lunarpages myself, so I might have missed something. You might confirm that "mysql" is the correct driver (maybe it's mysqli now, or something including "DBI"?). How old is the tutorial or other code examples that you are basing your code on? I know that with PHP, use of MySQL is discouraged (use MySQLi or DBI libraries). You also might confirm that you still have the right DB server name, and it wasn't changed/reassigned recently by LP.
If this username is unique to your Perl work, did you remember to grant it the appropriate privileges in your control panel?