title: PHP EXECUTE PERL w/ agruments
body: <p>I have the following php script which needs to call a perl script along with the arguments. If I have the paths correct, is there anything wrong with the syntax? The php and the perl on server side. The php receives information (the $GET['zipc'] thru a url. The perl script will produce an xml file back on the server. I keep getting  unexpected 'exec' (T_STRING) on line 8. Thanks for any advice.</p>
  
  <pre><code>&lt;?php
  $zipc="-Z";
  $lineup="-Y USA";
  $fformat="-U";
  $duration="-d 2";
  $outfile="-o";
  $ofile="guide.xml"
  exec("perl http://www.myserver.com/myperl.pl" $zipc $_GET['zipc'] $lineup $fformat $duration           $outfile "http://www.myserver.com/myfile.xml");
  print"FINALLY GOT TO END";
  ?&gt;
  </code></pre>
  
  <p>EDIT:
  Well I thought it was all worked out. Now I get the following error:
  Fatal error: Only variables can be passed </p>
  
  <p>According to the tech support people where I have the scripted hosted, I have to rewrite the line of code that contains the exec so as not to open connections. Kinda at loss on this one. Any advice?</p>
  
  <p>EDIT 2:
  The problem lies in the array. From what I understand an array can not be passed as shown in the answer without generating an error. To fix the problem I concatenate the variable and the $_GET into one variable. Seemed to fix the problem.</p>