title: Changing the PATH from perl
body: <p>So I need to call some perl scripts from another script. To make it work from the terminal I need to go to bash and then change the PATH:</p>
  
  <pre><code> export PATH=$PATH:/home/lsk250/www/portfolio
  </code></pre>
  
  <p>Now I need to run this as a CGI and invoke it from a browser, but obviously when I try to invoke the script from the browser, the PATH is not set so the script can't find the programs needed. How can I change the PATH from inside a perl script?
  I tried the following, without success:</p>
  
  <pre><code>system "export PATH=\$PATH:/home/lsk250/www/portfolio";
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$ENV{PATH} = '/home/lsk250/www/portfolio';
  exec 'env',cwd().'/'.$0,@ARGV;
  </code></pre>
  
  <p>Any ideas?</p>