in reply to [Solved] Internal Server Error

I tried moving the print $query->header; in index.pl to the fourth line (right after I use CGI) to no avail.

If that's true, then you never declared and initialized $query.

Furthermore, the initialization of $query and that print should be in a BEGIN block.

You seem to be having problem diagnosing a program using the program you're trying to diagnose. Have you considered using something external?

#!/bin/sh echo 'Content-Type: text/plain' echo '' /web/index.pl 2>&1

what do I need to do to fix this issue?

Comment out everything, then add back in bits till the problem resurfaces?