I am printing the header. I just didn't include all that in the post. The paths are correct. I comment out the sysopen and locking code and just try to leave the use Fcntl qw(:DEFAULT :flock); in and that causes the webpage to fail. I comment it out, and the page loads fine.
EDIT: the error is an Internal Server Error.