How can I install ActivePerl in Windows?
I am new to perl scripting. I have a Perl program I would like to run in Windows XP.
I heard that ActivePerl tool is used to run Perl scrips in Windows.
I tried to install ActivePerl but开发者_JAVA百科 the installation failed.
Please help me to install and to run some sample application.
These days I would suggest Strawberry Perl instead of ActivePerl. I would also suggest installing Padre to allow you to easily edit scripts. There is a Padre msi installer that also includes Strawberry Perl, so you can install both at the same time.
Once you have it installed, you can open Padre and type the following into it:
#!/usr/bin/perl
use strict;
use warnings;
print "hello world\n";
Then hit F5
or go to the Run menu and choose "Run Script". You will be prompted to save the file; choose a name like hello_world.pl. When you are done saving Padre will use Strawberry Perl to execute your program and will display its output in a sub-window named Output.
You are now ready to start your adventure with Perl 5. For the next steps, I would suggest reading Learning Perl and asking questions here and on the Perl Beginners mailing list.
I have been using ActivePerl for about eight years now and the installation never failed.
If you do not have administrative privileges, you can install it in a directory to which you have permissions. Note that the installer would not be able to modify system wide environment variables if you do not have administrative privileges. In that case, you should not check those options in the installer and manually add the locations C:\opt\Perl\site\bin;C:\opt\Perl\bin
(if you installed it in C:\opt
) to %PATH%
, associate .pl
, .wpl
and .plx
extensions with perl
, and add .pl
, .plx
and .wpl
to %PATHEXT%
(in your user environment).
You might choose to use Strawberry Perl which is fine, but you should understand why your installation attempt failed and how to fix it.
精彩评论