title: How to pass a string with spaces as http POST data using curl
body: <p>I am running a perl script that calls a bash script with arguments.
  It reads a string from a socket, splits it and saves it to an array. This is how such a string looks:</p>
  
  <pre><code>  22.12.13 20:21:12;RING;0
  </code></pre>
  
  <p>The first array element is a date, which is passed as an argument to a bash script.
  In the bash script, the arguments are passed on to curl as POST data.</p>
  
  <p>I don't know how to handle the space between date and time in the string.
  The curl is executed correctly and the server responds with OK (200). However it's only the first part (up to the space) that is passed as POST data. The time is missing. 
  curl gives the folowing error:</p>
  
  <pre><code>curl: (6) Couldn't resolve host '20:21'
  </code></pre>
  
  <p>These are the relevant lines from the scripts:</p>
  
  <pre><code>     #perl script
       my $EXTPRO="/path/to/script.sh"; 
  if ($_ =~ /RING/){ 
       my @C = split(/;/); 
       my @args = ($EXTPRO, $nr, $C[0], "String"); 
       system(@args);
  
  
  #bash script:
  curl http://url.com/add -F foo=$3 -F date=$2 -F foobar=$1
  </code></pre>