echo >test.txt perl - use HTTP::Request::Common; $a = POST qw[http://test/ Content_type form-data], content => [ qw,a b c d,, file =>['test.txt']]; die $a->as_string __END__