use WWW::Curl::Form; my $curlf = WWW::Curl::Form->new; $curlf->formaddfile($filename, 'attachment', "multipart/form-data"); $curlf->formadd("FIELDNAME", "VALUE"); $curl->setopt(CURLOPT_HTTPPOST, $curlf);