views:

63

answers:

2

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 the installation failed.

Please help me to install and to run some sample application.

+7  A: 

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.

Chas. Owens
could not update environment variable 'TERM'..verify that u have sufficient privileges to modify the environment variables..
Saranyya
this is the error i got it during installation
Saranyya
Does your user have administrator privileges?
Chas. Owens
If you are familiar with IRC then your best bet is to go to #padre on irc.perl.org. The developers hang out there and are very helpful.
Chas. Owens
daxim
@daxim Thanks, I was too lazy to hunt that down.
Chas. Owens
+5  A: 

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.

Sinan Ünür