in reply to pop3 and uucode
Use the module mimetools... it has full mime parsing/attachment decoding, etc.. everything you will need. If you want example source check (shameless plug) http://www.concentric.net/~micali/haxmail2.html ... which is exactly what you are trying to do.. perl based POP3 client.. full mime/attachment support and lots more. Opensource