Looks pretty straightforward to me. There's plenty of modules out there to help you. Try looking at DBI (the DataBase Interface module and its associated drivers) for your database connectivity and the various Mail:: modules (all available via http://search.cpan.org. There's even one called Mail::POP3Client...could be worth a close look.