Execute Perl programs from XAMPP in Windows

Perl means Practical Extraction and Reporting Language.  Perl is flexible, powerful and widely used programming language.

To execute programs in Windows, follow these steps :-


  • Then browse to folder C:\xampp\xampp\cgi-bin and paste/write your .cgi or .pl scripts :)



  • Generally, you run perl programs is executed in Linux Platform and since we are writing and executing perl program in Windows, we have to change shebang line i.e #!/usr/bin/perl



  • To do above task, delete/replace the line #!/usr/bin/perl by  #!"C:\xampp\xampp\perl\bin\perl.exe"  (This is as per my installation directory).   If you find it difficult, then do not worry, open printenv.pl file where you can find cgi-bin directory and copy the first line of printenv.pl file and replace shebang line of your perl script.



  • Now open browser and type http://localhost/cgi-bin/program_name.cgi or http://localhost/cgi-bin/program_name.pl


Thank you for reading this post. Please do comments if you like this post. Any queries about this post is whole heartedly welcomed :) :)