in reply to Re^4: json return value
in thread json return value

Do you know a way around this?

Yes, work through these checklists, when you find a problem on the list, use a solution from the list, when you find a problem not on the list (rare), post the error message and problem description here

brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts

I also see it described as text/cgi whereas some, but not all of the other cgi files are described as application/cgi. Any ideas why this is the case?

If your program is running as cgi (say under mod_cgi) then its responsible for that header, otherwise the webserver sent that header. However, chances are your cgi-bin isn't setup properly, cause  text/cgi and application/cgi are rare (plain text files are text/plain). So examine your server configuration and compare to https://httpd.apache.org/docs/2.2/howto/public_html.html#cgi / Apache Tutorial: Dynamic Content with CGI