in reply to running a perl program from a cgi webpage
Make sure that all directories have at least the "x" bit set for the user running the webserver.
Maybe /var/www/data is 777, but /var/www is 700 and belongs to root or something like this.
---- kurt