I did a quick search on Google and it looks like the "httpd/unix-directory" think might be an Apache configuration issue. Are you sure your CGI code is actually getting executed? Maybe add something like print STDERR "My CGI called here" and see if that message shows up in your Apache error log.
Comment on Re^3: Sending a file through STDOUT using HTTP