in reply to running cgi off the command line works, but running on the browser fails with a 500 error

Sounds like you aren't replicating the CGI environment on the command line properly.

Have a look at CGI::Capture.

It will do a really paranoid capture of the CGI call, and make sure it gets replicated to the command line properly.
  • Comment on Re: running cgi off the command line works, but running on the browser fails with a 500 error