Which web server / framework are you running (httpd,
Tomcat, etc.)?
I haven't use
Service Side Includes for a long time so I could be wrong, but shouldn't you be using
cmd= rather than
cgi= to execute a script and include the results in the page?
<!--#exec cmd="/cgi-bin/dir1/myscript.pl arg1 arg2" -->