Check out
this link, to an earlier discussion on perlmonks. It
has a piece of sample code using CGI.pm to get a file
upload, and also has a link to the rfc which describes
how multipart-form data looks internally.
Comment on Re: How do I parse multipart/form-data?!?