Install Perl on Windows XP

I extracted this part from my previous article MovableType Successfully Installed on Windows XP. From my log file, I found lots of my visitors came to my site with search keyword “Install Pearl on Windows XP“.

Install Perl on Windows XP

  1. Download ActivePerl for Windows XP from ActiveState. At the time I downloaed, the version was ActivePerl 5.6.1 build 633.
  2. After registering my user information, I choosed WIndows MSI package, which is 8.31M in size.
  3. It took me about 2 minutes and 51 seconds to download – thanks to the broadband provider – China Great Wall Broadband Corp[Chinese site]. I haven’t dreamed of downloading files larger than 5M in 10 minutes before.
  4. Install the MSI package. There is no any problem during the installation. I accepted all the defaul settings expect changing the default location from c:\Perl to c:\Program Files\Perl. I believe it is always good to follow the Windows convension instead of seeking for a place in root directory of C:\. This makes the disk hard to manage. Update: I am changing my mind recently. “C:\Program Files” folder is special in terms of Read-only settings and security permissions. Moving programs from their original location to this folder may bring unneccessary trouble if the program has never been tested in this environment.

Configure IIS for Perl and perl script with .CGI extension to work

  • I know it is wired for more green hand to have CGI run on Windows computer. At this time, if anyone access, it will prompt to download the file instead of see the result. I configured IIS to recognize .CGI extension just as it recognize .ASP or .SHTML.
  • In Inetmgr.exe, right click MT folder and select Properties. Click Create button in Application Settings area on Directory tab. Click OK to close the dialog box. Now we have created a seperate application.
  • Right click on Web Site node in Inetmgr.exe (the parent note of Default Web Site).
  • Click Add and enter the same parsing program (C:\program files\perl\bin\perl.exe “%s” %s for my case) and enter .cgi to Extension text box. Click OK. Note: The above changes can ONLY be changed on website level, not on applicaiton level, otherwise, the OK button will always be gray in the “Add/Edit Application Mapping” dialog box.
  • Click Configure and check the program to parse .pl files. It is C:\program files\perl\bin\perl.exe “%s” %s for my server.

More resources:

98 thoughts on “Install Perl on Windows XP

  1. Hi Jianshuo,

    It is a great website. Can you please tell me how I can run a simple “hello world” perl program in Windows XP? I tried “perl -v”, “perl” or “perl”. I saw a dos window flashed just 1/10 second and disappeared. What is wrong?

    Thank you for your time and help.


  2. Hi Jianshuo,

    I had the same problem as Tony. Whenever i used to run the file the window used to flash for fraction of a second and then it used to disappear. When i tried running it from the Dos prompt (as suggested by you) I got a message which said :

    can’t open perl script “”: No such file or directory. Can you please let me know what is the problem?



  3. Jyoti,

    You may have known this, but it is the only reason I can imagine – are in the current directory? Or please try to use the full path of, such as c:\temp\

  4. okay so I got the to work but I can’t get any other scripts to work. I created a file called and copied the text from into it and that doesn’t even work!

    need help, thanks

  5. Hi JianShuo, what do you mean by MT folder ? i dont see any folder with that name in Inetmgr.exe

  6. MT folder is a MovableType folder. You will not use it. I just take it as an example that before you configure the IIS, all CGI will not run. It will prompt to download instead of get executed.

  7. Hi,

    I cannot run .cgi files on my iis, tried virtually everything.

    Even, tried the steps you have mentioned

    Click Configure and check the program to parse .pl files. It is C:\program files\perl\bin\perl.exe “%s” %s for my server.

    Note: The following changes can be changed on website level, no applicaiton level. Click Add and enter the same parsing program (C:\program files\perl\bin\perl.exe “%s” %s for my case) and enter .cgi to Extension text box. Click OK.

    The problem is my OK button is always inactive (greyed out).

    I’m using Windows XP Professional


  8. Nitesh, seems I din’t express it clearly in my previous article. I was confused too when I read about it. The OK is gray for me too. I remember I have met the same problem when I wrote the article. I spent about 30 mintues to find out reason.

    Today, I just cannot remember the steps I used! I spent another 20 minutes and finally found the extension mapping can only be edited, but cannot be added.

    You can use the global setting. I have changed the article. Please read again to see if it works.

  9. Jian, thanks anyways for all the steps. Even I spent around 2 hours to figure it out. But got that OK button working. The problem was because of the long file name for Program Files, I changed it to Progra~1, then it worked. Maybe you can also add this to your Install Perl on Windows XP page for ready refence for other users.

    Just an useless problem, but too much time consuming.

  10. i need to find a web site to tell me about how to travel to china and the best places to go and to see. this is the best site i have seen yet.

  11. shanghai great 2 games do you have any this for only

    window xp just different person or anything or flag or ocean or cattle england or other look for that dragon different ????

  12. I’m trying to test an HTML page with CGI script on my Windows XP machine for test purposes only. I don’t intend to use this machine as the server to host the site. I don’t have iis installed. I can run perl programs without a problem but when going from the HTML form to the CGI script I see a flicker of another screen (looks like the file download screen)…and nothing else.

    I’d appreciate any insight into this.


  13. It is for sure that if you don’t have a web server, like IIS, your CGI script cannot run. CGI needs the webserver to get the request, parse it and then pass it to the CGI script. Then pass the output of the CGI script back to the browswer. So you need to install IIS to make sure your CGI work. To install IIS in Windows XP is easy.

  14. how do you run perl on a server that already has perl installed.

    example: i downloaded this script to get information from i look at my cPanel for my host, and it supports perl, but when i try to run it, i get a 500 internal server error. Is this the servers fault? does someone need to manually change the settings? is it CHMOD’s fault?(the file is sposed to make a new file that has database information)

    Thanks in advance,


  15. Hi

    I think you website is great and informative.

    A question on web design, how does your preview of the posting work?


  16. When I attempt to run, trhough IE6, I get the follwoing error…

    CGI Error

    The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

    Can’t open perl script “E:\customer\wangjianshuo\mt\mt-check.cgi”: No such file or directory

    It looks as if its tryign to open a local file on your server…?

  17. The problem with adding mappings on Win XP is that you need to type the period “.” with the file extension to enable the OK button.

  18. i’m trying to run a file on my xp server, when i type the localhost/Scripts/ it cannot be found. i tried changing the file inside the root, and it does work localhost/, the problem is that when i try with a file with scripts in it, it outputs the print command without evaluating the scripts. ex. my $animal = param(“animal”);

    print (“show me the $animal);

    the output to the browser is: show me the

    and that is it. i don’t know why it is like that. may be is the place it is saved (inside wwwroot), but it won’t even work if it is in inetpub/Scripts like the book i am reading says i should do it.

    please let me know how i can fix it. i’ll appreciate it.

    thanks LIDES

  19. i fixed it using a virtual directory, but when i look at it in the browser, it still does not output the variable’s value. it only says show me the

    and nothing else. i think it is not evaluating the scripts. how do i fix it.

  20. I have Windows XP Professional in a system at home. I would like to practice Object Oriented Perl at home, but unfortunately I do not have Perl installed on it.

    Please let me know as to how can I install Perl and make use of it.



  21. Isn’t there any way to run perl programs without using your computer as a server or installing Apache or IIS? I have the same thing happen when trying to open the .pl file, a dos window which quickly disappears when I use the backward slash in the URL to point to the .pl file in the browser, (it’s on my system, not online) and I get a “open file or save file” prompt when using the same URL with forward slashes. (C:/Documents and Settings/blahblah). I use XP Home Edition, and have no plans to use this computer as a server, but I want to educate myself on the uses of CGI/Perl. After appearing to learn that IIS is only available on XP Pro (still not real sure about that one, but I don’t find it on my system) I decided to intall Apache — merely for the purpose of toying with perl scripting — of course it works fine. But, why did I have to do this, or is there any way at all I can get perl scripts to work in XP Home Edition without being a server, without setting up “virtual hosts” etc.? What was Microsoft thinking making it so difficult? I had no problem executing perl scripts on Windows 98. By the way, I have seen your blog at least 2 dozen times in a variety of searches, and appreciate your contribution to general information sharing. Very nice. Thankyou.

  22. Shelly –

    I came across the same problem – I also use WinXP SP2 Home edition and was just wanting to run some perl scripts … anyways, you have to:

    1. Open notepad to type your perl script ala:


    print “hello world\n”;

    2. Save as and save it under in C:\whatever

    3. Open your command prompt (start>run>cmd)

    4. Type in c:\whatever\ and press enter

    5. Presto!

    Hope this helps.

  23. Hi,

    I have a naive question about Perl. What is the function of the souce code of Perl?


  24. I’m a newbie to Perl. The problem I am having is that I am not sure how to start. All the books tell me how to write involved programs but I’m stuck at the basics and not one of them talks about it! I have installed perl for Windows XP, and have also installed emacs. I now have an icon for Perl and an icon for emacs on my desktop. My problem is that after I write a program (using emacs) and save it, how do I execute it? I click on the Perl icon and a blank window opens up, and whatever I type in it elicits no response. The cursor simply moves to the next line. Shouldn’t this window have some kind of prompt at which we type commands?

    Thanks for any help.

  25. Hi,

    I tried Active Perl for download but it give me option for Window NT and Me only. I tried window NT on my XP home edition but it gave me error message for wrong OS.

    Any suggestion?



  26. hello,

    i wrote a form mail script for someone else.

    it works fine on my machine but not on his. Then I find out he’s running on Windows.

    What is the “standard” path for perl on windows (my program is /usr/bin/perl but obviously that’s not right for windows.)

    Also what is the equivalent for sendmail (in Linux its /usr/lib/sendmail)


  27. FANTASTIC! Perl up and working on my PC in minutes!!!!

    You’re a star!

  28. hey ican use perl on my linux box but not on X and win98 . suggest me where to go n wat to do

  29. Hello,

    I’m trying to use Windows Server 2003 to stream files with Darwin. To install Darwin, I have to install Perl 5.8. Perl gives me a successful installation to the default location c:\Perl. After Perl, I install Darwin for Windows, but the installation process does not complete. It stops when Darwin asks me to enter a username/password to be used with Darwin. Then it gives me this error:

    “Perl is not properly installed on your system. The installer requires Perl to run the Streaming Admin Server.

    Please make sure the path to the Perl interpreter is in your system path and run c:\Program Files\Darwin Streaming Server\”

    I’ve looked at the path, and it’s set correctly. I have tried other things with no luck.

    Any suggestions would be greatly appreciated.



  30. Hello friends,

    I have the same trouble described by etrabal in the previous e-mail. Could anybody help us?



  31. hello friends,

    can you give how to configure in apache server…for running perl scripts.actually they are getting downloaded when tried to execute in the browser..plzzzzz give me a solution

  32. ok, the problem with the darwin streaming server on windows is the version of perl. It does not work with perl 5.8.7 (which is the latest). Use 5.8.6, which you can get from the archive dir on

    of course, there may be security bugs in 5.8.6. make sure you aren’t exposing yourself to them by using it.

  33. hi…i’m new to perl programming. i’ve worked with C. Could anyone tell me about the pre requisites of learning to program in perl. and how is a perl program written in windows and how is it executed?

  34. Hi all,

    I am new to Scripting language. I am supposed to glue 3 components which are written in c++ viz Encoder, Decoder and validator. I have to automate the testing process- The encoder should read the .xml file, encode it call decoder and decode it and then validator should be called. This process should be repeated till all .xml files are exhausted. Can anyone suggest me how to proceed.

  35. This article is amazing! Was a great help when I was trying to install this time tracking solution.

  36. hi,

    As we are doing our project on MRTG, we have installed PERL on windows xp.

    Is there any additional thing need to be downloaded to run PERL on Windows xp?

    Thank You…

  37. hi,

    will u tell me how to declear the variable?

    how to initilize the value?

    how to use the conditional oprator?


  38. hi,

    when i run perl program on windows as perl,i get errror as a

    ‘perl is not recognised as internal or external command,perable program or batch files.

    Please give solution

  39. Hello Jian Shuo Wang n friends,

    just want to say this article is simple and yet works! :)

    Thank you Jian Shuo Wang

  40. i download and i install it. but the problem i cannt install any modules using ppm. from the cmd prompt when type ppm it doesnt show anythig and when type ppm3-bin –shows that ppm prompt but i cant install any modules there. i have internet connection. it shows some error message : connection error. why?

  41. hi, i installed apache software on my machine as well as perl, how do i make my perl script run on my apache web server bcoz when i try to run them, it wants me to dwonload the file instead, Thanx

  42. Hi Jianshuo,

    I have a question about my Perl installation in Windows XP. I followed your directions but when I run a script from the command line it does not recognize the Perl commands such as % or $. I t states that % (or $) “is not recognized as an internal or external command, operable program or batch file.”

    I have tried to run the script from the c: as well as the c:\perl directory but I get the same message.

    When I key in: “perl -v” I get a response that shows perl is installed.

    Any idea what my problem is? Should I be using the perl package manager (ppm) window instead? If so how?

    I am trying to run some hacks for google and am not a big perl programmer (or programmer of any sort).

    BTW, I visited China five years ago and had a great time but I didn’t get to Shanghai (next time!).

    Dave (in Los Angeles, CA)

  43. hi,

    i am currently working with windows XP. how to install CGI script in tomcat (version 5.0.25)?

  44. I’ve installed the phptriad 2.2.1 and want to run one webpage locally using and instead of showing the “hello world” on the page, the internet explorer try to download the file. What’s wrong, what should I do to run the script on the internet explorer.???

    Help please, hope you can send the answer to , thanks!!

  45. Hey Jianshuo,

    I was looking for installation process of Perl in winXP,,,,,,exactly what I got from u……….Thanks a lot..

  46. Hi ! all,

    I am unable to run perl from windows..the Dos prompt says ‘Perl’ is not recognized as an internal or external command or batch file..

    Could anybody know what the problem is ..I have just started learning perl..

    Thanks in advance,


  47. I am very much to learn and use PERL.But when I tried to install in my WinXP system it displayed a message saying that its not a valid win32 application. What should I do? Please help me !!!

  48. This page was nearly useful. Nearly.

    # Right click on Web Site node in Inetmgr.exe (the parent note of Default Web Site).

    # Click Add

    Add what?

    Sorry. Slightly frustrated here. Have spent 6 hours trying to get an OpenSource search thing up and running. No luck yet.

  49. Hello Jianshuo,

    I am completely new to perl. I have installed it in C: but now what to do to start programming.Tell meme DOS comands needed to open programing page.

  50. Hi Jianshuo,

    I din get wot u meant by

    “In Inetmgr.exe, right click MT folder and select Properties. Click Create button in Application Settings area on Directory tab. Click OK to close the dialog box. Now we have created a seperate application.”

    where is this Inetmgr.ext and Moveable Folder.

    Sorry buddy, I’m new to this.



  51. $pi =3.1415;

    print “Enter the radius of the circle? “;

    chomp($radius = );

    $circ = 2*$pi*$radius;

    print “The circumference of a circle of radius $radius is $circ\n”;

    Can somebody help. I am using perl in windows xp. I have the stdin funciton (please see the above small program). The user should enter a value and press enter. But the

    problem is as I enter a value and press enter, the DOS windows closes.

    How do i make the DOS window stay open after I press the enter key.




  52. i have downloaded an example which includes a file . i use windows xp and perlactivate is installed . how to run the file plz help me i am novice

  53. Can you please explain how to get Net::LDAP module installed on Windows, specifically?



  54. Can you please explain how to get Net::LDAP module installed on Windows, specifically?



  55. guys

    i think you should download perl express its a

    A free Perl IDE for Windows 98/Me/2000/XP/2003, includes multiple tools for writing and debugging your perl programs.

    using this u neednt have to keep writing in notepad and then going to command prompt and all that.. u will just be working in a single window.. and running ure scripts..

    its very useful and makes life simpler for both beginners and experienced people

    have fun using it

  56. Hi,

    I am new to perl…..I’ve active state of perl program… now hw to Install tat….. wen i installed it said, i got errror as ‘perl is not recognised as internal or external command,perable program or batch files.”

    what is the steps to install perl…….

  57. I am new to perl and after i installed it, what i have to do next ?

    i need to create a web server first or what?

  58. Thank a lot for the above information. It is really very helpful.

    One more thing…

    I am new to perl and after i installed it. I am looking for the framework to test the PERL APIs.

    Can you suggest me any tool for writing and testing the already available methods.


  59. Error code 129, while making ‘blib\arch\auto\Crypt\SSLeay\SSLeay.dll’

    i have downloaded perl v5.10 from strawberry..

    i try to install Net_SSLEAY but if give above error..

    give some solution

  60. I have studing the c prog I have TURBO C software in my comp. but i am not geting how to start it. Pl tel me sir.

  61. Hi Sir,

    I am new to programming. I read through your article. There is something i couldnt understand. My perl window is flasing and closing out. I am not able to open Perl -v. But as you said, when i tried the full path with CMD it worked. Is there a way i can open perl -v and sustain it. I run an AMD. Please advise.


  62. Jian Shuo Wang-

    Thank you for the lovely web site. I am only passing through at the moment but you seem like an interesting fellow and so I am bookmarking you. I like simplicity in design, and I think this looks good so far.

    I was searching for general infos before I try to install Perl, by the way, and that’s how I arrived here.

    Best wishes to you!


  63. Hi,Jianshuo

    dear sir i trying to install perl in windows7 , when i am puting ticks on all available options.. after installation completed it is giving an message that perl installation successful ,unable to set path.. do it manually.

    after typing perl -v in the cmd prompt it is showing

  64. Hi,

    I am trying to run a genetics program called QDD through ActivePerl on Vista.

    I keep getting the following error:

    ”perl is not recognised as internal or external command’

    would you be able to help?



  65. Hello, i have installedactive state perl in C:/usr and installed perl express in c:/programfiles/perlexpress. Then i created a perl file named I took comand prompt and typed perl and found it running. I was happy that i got the o/p. But when i tried to run it from the perl express it showed an error ‘error:1095 indicating perl interpretor not installed. Please give me a solution for this.

  66. Hi,

    i am not able insall ActivePerl- in Windows XP machine. Get an error when click on the installer.bat file get an error saying “perl.exe is not a valid Win 32 application”.

    Please suggest.



  67. Hi there,

    After installed ActivePerl 1202 on Windows 7 and ran the first perl command, I got error as below:

    c:\>perl -v

    ‘perl’ is not recognized as an internal or external command,

    operable program or batch file.

    Any advise will be appreciated.



  68. Hi,

    i am new to perl. when i try to run a perl program from cmd, i get an error saying: ‘perl is not recognised as internal or external command,perable program or batch files’

    help me to resolve this problem. thank you in advance.

  69. Hello There

    My Name is maria

    We Find Your Website From Google. We want to buy an article on your Web site. Need General Guest Post On Your Website. Tell Me the Price Please.


    If You Accept Casino Link, Tell Us Yes Or Not. If you Have More Websites Please Send them to Us. We Write An Article Related To Your Topic.

    Waiting for Your Response


Leave a Reply

Your email address will not be published. Required fields are marked *