I am new to the Perl language, and I tried running it as I do for PHP files, by putting files in htdocs and then accessing them over localhost.
Below is the Perl file which I created, but wasn't able to run over localhost:
-----hello.pl---------------
#!/usr/bin/perl
print "Hello World.\n";
hello world program:
#!C:\xampp\perl\bin\perl.exe
# The above line is perl execution path in xampp
# The below line tells the browser, that this script will send html content.
# If you miss this line then it will show "malformed header from script" error.
print "Content-type: text/html\n\n";
print "Hello world."
Now start apache from xampp control panel. And in browser's url, enter localhost/perl/hello.cgi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With