How to install Perl in windows
Super easy steps to install Perl in Windows
If you using a windows machine and want to install Perl, below are the steps that needs to be followed,
1. Check if Perl is installed
You can check if perl is installed in your windows machine by opening command prompt and typing below command
perl -v
If perl
is present you should get perl
version in the output
PS: if you type perl -V
you’ll get a more detailed view on how and where perl
is installed in your machine
2. Download Perl
If you do not have Perl installed, install strawberry Perl
for windows here.
Once installation is complete, open command prompt and type in perl -v
, you should get the installed perl version as output. It should look something like below
[Chirags-MacBook-Air:chiragspdevBlog chiragsp$ perl -v
This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
Copyright 1987-2020, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
3. Write your first Perl Program
Now that the boring configuration part is complete, lets begin with the actual coding part.
As its customary when writing any new language, lets start with a Hello World
program.
Open a new file in notepad and type in below Perl Hello World
program,
#!usr/bin/perl
print "Hello World!";
And save this as Hello.pl
file. pl
is the perl extension
4. Execute the Perl Program
To execute a Perl program, open command line and go to the location where the newly created Hello.pl
is present and then type
perl Hello.pl
You should get an output as Hello World!
Great Job! on running your first Perl program. Next we’ll try running perl
via Apache server. Checkout the article under this tag here.