title: Perl LWP Post form-data with my boundary
body: <p>I want to post data with content type <code>multipart/form-data</code>:</p>
  
  <pre><code>use strict;
  use warnings;
  
  use LWP::UserAgent;
  
  my $ua = LWP::UserAgent-&gt;new;
  $ua-&gt;post (
      'http://127.0.0.1:12555',
      'Content-Type' =&gt; 'form-data',
      Content =&gt; {
          'data1' =&gt; rand,
          'data2' =&gt; rand,
      }
  );
  </code></pre>
  
  <p>And i tested the submitted data:</p>
  
  <pre><code>use strict;
  use warnings;
  use IO::Socket::INET;
  use Socket qw ( inet_aton );
  
  my $sock_listen = new IO::Socket::INET (
      LocalHost =&gt; '127.0.0.1',
      LocalPort =&gt; '12555',
      Proto =&gt; 'tcp',
      Listen =&gt; 3,
      Reuse =&gt; 1,
  );
  $sock_listen-&gt;autoflush ();
  
  my $sock;
  while ( $sock = $sock_listen-&gt;accept ( ) )
  {
      my $data = '';
      $sock-&gt;recv ( $data, 4096 );
      print $data . "\n";
  }
  </code></pre>
  
  <p>Test #1 result:</p>
  
  <pre><code>POST / HTTP/1.1
  TE: deflate,gzip;q=0.3
  Connection: TE, close
  Host: 127.0.0.1:12555
  User-Agent: libwww-perl/6.05
  Content-Length: 162
  Content-Type: multipart/form-data; boundary=xYzZY
  
  --xYzZY
  Content-Disposition: form-data; name="data2"
  
  0.876556396484375
  --xYzZY
  Content-Disposition: form-data; name="data1"
  
  0.62921142578125
  --xYzZY--
  </code></pre>
  
  <p>Test #2 result:</p>
  
  <pre><code>POST / HTTP/1.1
  TE: deflate,gzip;q=0.3
  Connection: TE, close
  Host: 127.0.0.1:12555
  User-Agent: libwww-perl/6.05
  Content-Length: 163
  Content-Type: multipart/form-data; boundary=xYzZY
  
  --xYzZY
  Content-Disposition: form-data; name="data2"
  
  0.896942138671875
  --xYzZY
  Content-Disposition: form-data; name="data1"
  
  0.041656494140625
  --xYzZY--
  </code></pre>
  
  <p>I added a data:</p>
  
  <pre><code>        'data3' =&gt; '--xYzZY'
  </code></pre>
  
  <p>and got:</p>
  
  <pre><code>POST / HTTP/1.1
  TE: deflate,gzip;q=0.3
  Connection: TE, close
  Host: 127.0.0.1:12555
  User-Agent: libwww-perl/6.05
  Content-Length: 221
  Content-Type: multipart/form-data; boundary=Tegj
  
  --Tegj
  Content-Disposition: form-data; name="data2"
  
  0.34613037109375
  --Tegj
  Content-Disposition: form-data; name="data3"
  
  --xYzZY
  --Tegj
  Content-Disposition: form-data; name="data1"
  
  0.678955078125
  --Tegj--
  </code></pre>
  
  <p>The question is how i can set the <code>boundary</code> manually to 32 chars string like browser's <code>----WebKitFormBoundary[...]</code> using <code>LWP</code>?</p>
  
  <p>Or can just use <code>IO::Socket</code>?</p>