in reply to Email Attachment

See MIME::Parser. Also, if a script can read from STDIN, you can feed it from a file.