You probably want something like Net::POP3 or Net::SMTP (depending on if your server is a POP3 server or an SMTP server). Use it to retreive your message headers and do whatever it is you want to do with your email.
Hope that helps,
Shendal
Update: As pointed out by le in reply below, SMTP is send only, of course. I wanted to say Net::IMAP -- sorry for the confusion.