How to install Perl under Windows XP

Topics on common programming languages
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

How to install Perl under Windows XP

Post by Neo » Wed Apr 06, 2011 3:25 pm

  1. Go to http://www.activestate.com/activeperl/downloads and download the version you want. In my case, I download the x86 version which is 5.12.3 at the time of making this tutorial. The Installation file is 24.6 MB.
    1.PNG
    1.PNG (64.76 KiB) Viewed 6619 times
    I was downloading with Opera which took about 2 minutes to download the file.
    2.PNG
    2.PNG (8.82 KiB) Viewed 6619 times
    The download files was named as ActivePerl-5.12.3.1204-MSWin32-x86-294330.msi
  2. Double click on the file and continue through the installation process as below. (I didn't want to do any change rather than keep pressing on Next)
    3.PNG
    3.PNG (41.32 KiB) Viewed 6619 times
    4.PNG
    4.PNG (24.59 KiB) Viewed 6619 times
    5.PNG
    5.PNG (22.62 KiB) Viewed 6619 times
    6.PNG
    6.PNG (21.05 KiB) Viewed 6619 times
    7.PNG
    7.PNG (16.27 KiB) Viewed 6619 times
    8.PNG
    8.PNG (17.49 KiB) Viewed 6619 times
    9.PNG
    9.PNG (40.48 KiB) Viewed 6619 times
  3. After finishing the installation, we can try to run a Perl script file to display Hello World. Open a text editor (Notepad is fine), type following code and save the file as hello.pl.

    Code: Select all

    #!/usr/bin/perl
    print "Hello World!\n";
    
    I use NotePad++ (free) which support syntax highlighting for Perl.
    11.PNG
    11.PNG (18.76 KiB) Viewed 6619 times
  4. Now open command prompt (Start Menu -> Run -> Type "cmd" and Enter) and change directory to the folder with your file. You can list down file using dir command to see whether the file exists.
    10.PNG
    10.PNG (14.08 KiB) Viewed 6619 times
  5. Now type hello.pl to run the Perl script file you have just created.
    12.PNG
    12.PNG (14.5 KiB) Viewed 6618 times
  6. If you want to run CGI scripts written using Perl under Apache Web Server, then have a look at How to configure Apache server to run Perl CGI files tutorial.
  7. If this is useful, don't forget to say thanks! :)
Post Reply

Return to “.Net & Other Programming”