mrj Posted September 12, 2017 Share Posted September 12, 2017 Hi,I am learning perl. I created a hello world example file called "test.pl" and the URL is: http://netrix.ml/cgi-bin/test.plWhen I visit this page via browser it returns 500 error. I'd chmoded it to 755. But still not worked. The test.pl contains following code:#!/usr/bin/perl print "content-type: text/html \n\n"; print "Hello, Perl!"; Link to comment Share on other sites More sharing options...
Luigi123 Posted September 12, 2017 Share Posted September 12, 2017 This support request is being escalated to our root admin. Link to comment Share on other sites More sharing options...
Krydos Posted September 12, 2017 Share Posted September 12, 2017 You used the wrong file encoding http://netrix.ml/cgi-bin/test2.pl Linux is very particular about dos line endings. I recommend using the file manager in cpanel, then click the code editor button to make sure your files have proper linux encoding. Either that or you can use an editor like notepad++ on windows. Link to comment Share on other sites More sharing options...
mrj Posted September 12, 2017 Author Share Posted September 12, 2017 which encode should I use? UTF-8 or something else. Please tell me. Link to comment Share on other sites More sharing options...
Krydos Posted September 12, 2017 Share Posted September 12, 2017 Yes, UTF-8 will work. The main thing is it has to have linux line endings, not dos line endings. Link to comment Share on other sites More sharing options...
mrj Posted September 17, 2017 Author Share Posted September 17, 2017 It's working when I save files with Linux line ending Thanks Link to comment Share on other sites More sharing options...
Recommended Posts