tags:

views:

127

answers:

4

I just recently installed ActivePerl 5.12.2.1202 on my Windows XP in C:/Perl. I am new to Perl scripting.

I just want to run a Perl program which contains one print statement, which I saved in Notepad with the name ex.pl.

  1. How can I run this Perl program?
  2. Can I use an editor for typing a Perl script other than Notepad?
  3. How do I use ActivePerl?
+1  A: 

This should help you. I think you can find hundreds of Hello Worlds on Internet.

Chathuranga Chandrasekara
+5  A: 
Nikhil Jain
+3  A: 

Perl programs (or any other program run by an interpreter) is run by passing the script as a command-line argument to the interpreter. For example, in this case:

perl.exe ex.pl

Padre the Perl IDE and Kephra are good editors for Perl.

As an alternative to ActivePerl, there is Strawberry Perl.

Alan Haggai Alavi
+1  A: 

Perl programs are run using the Perl interpreter, perl.exe. This is normally done from the command line:

C:\>C:\Perl\bin\perl ex.pl

If perl.exe is in your PATH environment variable that can be shortened to:

C:\>perl ex.pl

If you opted to have *.pl files associated with Perl during installation, you can also double-click on them from Windows Explorer.

If you have *.pl files associated with Perl and add .PL to your PATHEXT environment variable you can run them like any other executable:

C:\>ex

Perl programs are just text files. They can be edited with any text editor (Padre, Kokomo, vim, emacs, Notepad++, etc.). Use whichever one you like best.

ActivePerl is just a distribution of Perl. "Using" it usually means running perl.exe to execute your program. ActivePerl also includes the PPM (Perl Package Manager) utility to make it easier to install modules from CPAN, particularly if you don't have a C compiler available. Most experienced Perl developers prefer to use the cpan shell.

Michael Carman