Search code examples
perlapachecgicgi-bin

Unable to write file with Apache CGI scripts


I want to add some logs to my CGI scripts with Perl code like this:

open(LOG, ">/path/to/my.log") or die;
print LOG "Some content...\n";
close(LOG);

However, logs are never written to my log file, while the scripts are still correctly handling requests.

I'm not very familiar with Apache, CGI and Perl, so gurus please shine a light.


Solution

  • The problem has been solved: changes to my Perl script take effect only after restarting Apache. Not sure why it behaves like this because I am thinking Perl is an interpreted language and it can be modified on the fly...