.:: Welcome To My Personal Blog ::.

Saturday, March 5, 2011

Beginner's Guide To Travel With Perl - Part 1

Something about Perl

Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular amongst programmers. Perl borrows features from other programming languages including C, shell scripting (sh), AWK, and sed. The language provides powerful text processing facilities without the arbitrary data length limits of many contemporary Unix tools, facilitating easy manipulation of text files. Perl gained widespread popularity in the late 1990s as a CGI scripting language, in part due to its parsing abilities.



In addition to CGI, Perl is used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications. Perl is nicknamed "the Swiss Army chainsaw of programming languages" due to its flexibility and power. It is also referred to as the "duct tape that holds the Internet together", in reference to its ubiquity and perceived inelegance.

Source : http://en.wikipedia.org/wiki/Perl
Official Website : http://www.perl.org/

To download Perl, please visit the official site and download the version compatible with your operating system.

Beginning Perl

We have to download and install Perl in our system and then we’re ready to go. Let’s write a program to print “Hello World!”

Open notepad and write the following –
print “Hello World!”;

Save the file as "hello.pl". Note that, the extension must be ".pl". Run it from command line by writing “perl hello.pl”.
To open command line go to Start menu, click on run, write “cmd” and press enter. Go to the directory where the .pl file is located and then give the command “perl file_name.pl”. Now we can see the output.
In every case, we have to do the following to run a code with Perl. To just compile the code type “perl -c file_name.pl” The result will tell about compilation error if there is any error.
In a Perl code, every statement must be ended with a semicolon.
To write comment we have to add just an extra ‘#’ before the comment line. Then it will be ignored when compiling the program.

Example:
#This is comment and will not be shown in output.
print “This program has a comment.”;
Save it as “comment.pl” and run from command line. We can see the output “This program has a comment.”


Help Links:

http://www.perl.com/pub/2000/10/begperl1.html
http://perldoc.perl.org/perlintro.html

http://www.perl.org/learn.html
http://learn.perl.org/books.html
http://learn.perl.org/tutorials/
http://www.perl.com/pub/2008/04/23/a-beginners-introduction-to-perl-510.html
http://docstore.mik.ua/orelly/perl2/prog/ch01_05.htm
http://www.tizag.com/perlT/perluserinput.php
http://www.tizag.com/perlT/perlchomp.php

http://perldoc.perl.org/functions/use.html
http://www.well.ox.ac.uk/~johnb/comp/perl/intro.html

http://www.sthomas.net/roberts-perl-tutorial.htm/ch22/use_strict_
http://docstore.mik.ua/orelly/perl/prog3/ch31_19.htm
http://debugger.perl.org/580/perldebtut.html
http://perldoc.perl.org/strict.html


. . . . . To be continued . . . . .

1 comment:

  1. Very Nice Mahfuzur Rahaman.
    You write the tutorial at appropriate time when we are moving to and fro for it.

    I am starting to read.

    Excellent tutorial.
    Well done .
    Go ahead.

    ReplyDelete

Popular Posts