in reply to Reading mail With attachments.

Check out the MIME::Parser module. It has all the tools you will need to parse (and also build) MIME encoded messages.