Install Perl on Windows XP
By Jian Shuo Wang on 2002-11-24 23:03 · InternetI 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
Download ActivePerl for Windows XP from ActiveState. At the time I downloaed, the version was ActivePerl 5.6.1 build 633.
After registering my user information, I choosed WIndows MSI package, which is 8.31M in size.
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.
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 http://home.wangjianshuo.com/mt/mt.cgi, 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:
My tips to build a website
97 Comments
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 example.pl" or "perl myfile.pl". I saw a dos window flashed just 1/10 second and disappeared. What is wrong?
Thank you for your time and help.
Tony
Start -> Run -> "cmd" -> OK
("command" in Windows 98)
Then type perl example.pl
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 "example.pl": No such file or directory. Can you please let me know what is the problem?
Thankyou,
Jyoti
You may have known this, but it is the only reason I can imagine - are example.pl in the current directory? Or please try to use the full path of example.pl, such as c:\temp\example.pl.
need help, thanks
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
Thanks
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.
Just an useless problem, but too much time consuming.
window xp just different person or anything or flag or ocean or cattle england or other look for that dragon different ????
I'd appreciate any insight into this.
Thanks
example: i downloaded this script to get information from amazon.com. 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,
Blayne
PCBunk.net
I think you website is great and informative.
A question on web design, how does your preview of the posting work?
Martin
just wondering whats the difference between activPerl and Perl5
cheers
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...?
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
and nothing else. i think it is not evaluating the scripts. how do i fix it.
Please let me know as to how can I install Perl and make use of it.
Regards,
Sourav
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:
#!/usr/bin/perl
print "hello world\n";
2. Save as hello.pl and save it under in C:\whatever
3. Open your command prompt (start>run>cmd)
4. Type in c:\whatever\hello.pl and press enter
5. Presto!
Hope this helps.
I have a naive question about Perl. What is the function of the souce code of Perl?
Thanks:)
Thanks for any help.
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?
Rgds,
Ben
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)
Thanks
You're a star!
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\streamingadminserver.pl"
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.
Thanks,
Etrabal
I have the same trouble described by etrabal in the previous e-mail. Could anybody help us?
Thanks,
Luis
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
of course, there may be security bugs in 5.8.6. make sure you aren't exposing yourself to them by using it.
2) Run this exe
3)In Windows search ,try finding .pl files.
U will get the path whre perl was installed
(I got F:\Perl\ )
4)start->RUN->cmd->F:\Perl\eg\example.pl
Avirup
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.
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...
will u tell me how to declear the variable?
how to initilize the value?
how to use the conditional oprator?
thank's
when i run perl program on windows as perl world.pl,i get errror as a
'perl is not recognised as internal or external command,perable program or batch files.
Please give solution
just want to say this article is simple and yet works! :)
Thank you Jian Shuo Wang
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)
i am currently working with windows XP. how to install CGI script in tomcat (version 5.0.25)?
Help please, hope you can send the answer to [email protected] , thanks!!
I was looking for installation process of Perl in winXP,,,,,,exactly what I got from u..........Thanks a lot..
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,
Raghu
# 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.
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.
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.
Thanks,
Ravi
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.
Thanks
George
05-10-2007
Thanks,
-Esther
Thanks,
-Esther
i think you should download perl express http://www.perl-express.com/. 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
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.......
i need to create a web server first or what?
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.
Thanks.
i have downloaded perl v5.10 from strawberry..
i try to install Net_SSLEAY but if give above error..
give some solution
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.
Girish
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!
bc
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
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?
Cheers,
Dave
i am not able insall ActivePerl-5.10.1.1007-MSWin32-x64-291969 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.
Thanks,
Rajneesh
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.
Thanks,
Willie
Thanks,
Willie
can i hack any server by using perl
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.