in reply to CGI file writing

Try this (untested)
my $cgidir = '.'; my $logfile = 'search_log'; my $filename = $cgidir.'/'.$logfile;
It should put the log file in cgi-bin

jdtoronto

Updated corrected missing slash between path and filename. Thanks bart