We Can Execute Perl script in Two ways !
*) Commond Line Execution.
*) Webbased Execution.
Command Line Execution :
Place your perl script on this path like test.pl
Script is.
#!”D:\xampp\perl\bin\perl.exe”
print “Hello World”;
Go to command prompt and go to perl path like D:\xampp\perl.
run it as D:\xampp\perl>perl test.pl
Webbased Execution :
Second way is to execute through web. Place your perl scirpt file at path D:\xampp\cgi-bin
Make sure that the Apache configuration file
D:\xampp\apache\conf\httpd.conf
this script
ScriptAlias /cgi-bin/ “D:/xampp/cgi-bin/”
to be not been commented and the folder name should be same as the apache settings. Now start apache and place the url as
Place the perl script at D:/xampp/cgi-bin/test.pl
test.pl has the perl code has you should say the header type as print “Content-Type: text/html\n\n”; for web based execution.
#!”D:\xampp\perl\bin\perl.exe”
print “Content-Type: text/html\n\n”;
print “OK”;
http://localhost/cgi-bin/test.pl
Your perl script will get executed. Enjoy !!

Leave a Reply