title: Calling perl from php?
body: <p>I have a php script that handles a form input. For design reasons both a bit out of my control, and which I do not entirely wish to change, I have to call a perl script with the parameters specified in the html form. </p>
  
  <p>I sanitized all inputs and then output them to a file called input, which is read by the perl script named, for sake of brevity in this question, script.pl. Script.pl should do some stuff and then write all outputs to a file named output.</p>
  
  <p>I call the perl script from php like so:</p>
  
  <pre><code>system('perl script.pl 2&gt;errors');
  </code></pre>
  
  <p>No good, nothing happens. output is not created, errors is not created, and the side effect does not occur. </p>
  
  <p>My apache runs as www-data user and group id. My directory is set with 775 settings with ownership as me:www-data. (My user name is replaced with "me" for sakes for privacy).</p>
  
  <p>My question is two fold:
  1) Am I doing this wrong? If so how should I improve upon the code?
  2) Is there a more sane way to catch errors in system execution?</p>
  
  <p>After programming in perl for a while, php feels like a pain in the ass. </p>
  
  <p>OS: Ubuntu server edition</p>