And no errors show up in my error logs and no error is displayed
That's because the script is not generating an error, the CGI environment is. As haukex says, you need to output some headers.
Simply adding:
print "Content-type: text/plain\n\n";
somewhere before you print the output should solve the problem.
Generally if you include use CGI::Carp qw(fatalsToBrowser); the only reasons for a 500 error will be that the script cannot start (permissions or other issues) or it is not printing headers first.