title: Error running perlbrew script though apache+suexec
body: <p>We have a server running Centos 5.11, Apache 2.2 and default perl. Running scripts through suexec is working "just fine", but I have installed perlbrew so that I can install a load of extra modules without interferring with it.</p>
  
  <p>I have created a simple perl script to test:</p>
  
  <pre><code>#!/usr/bin/perl
  print "Content-type: text/html\n\n";
  print "perl: ". $^X . "\n";
  </code></pre>
  
  <p>When run through apache+suexec, it outputs, as expected:</p>
  
  <pre><code>Hello, world! perl: /usr/bin/perl
  </code></pre>
  
  <p>But, when I change the shebang line to:</p>
  
  <pre><code>#!/root/perl5/perlbrew/perls/perl-5.22.1/bin/perl
  </code></pre>
  
  <p>and run the same way, I get an internal server error, and the apache error log shows:</p>
  
  <pre><code>suexec failure: could not open log file
  fopen: Permission denied
  Premature end of script headers: test.cgi
  </code></pre>
  
  <p>but running at the command line is fine:</p>
  
  <pre><code># ./test.cgi 
  Content-type: text/html
  Hello, world!
  perl: /root/perl5/perlbrew/perls/perl-5.22.1/bin/perl
  </code></pre>
  
  <p>I've tried all sorts of things. I did wonder if it's a "PATH" issue, but apache docs say "On 2.2, the PATH environment variable cannot be set using Setenv."</p>
  
  <p>The suexec errors usually seem to be caused by dos/unix encoding - but that's not an issue here.</p>
  
  <p>Might it be an issue with the way I've installed perlbrew? Should it be as a different user (as apache)? different location (under /var/www)?</p>
  
  <p>Any other suggestions welcomed!</p>