Chapter-1: Perl programming language introduction

0
874

Perl is a programming language  was developed by Larry Wall. Perl language especially used for text processing on Linux, UNIX, Mac OS & Windows operating systems. Full form of PERL is Practical Extraction and Report Language. Because Perl’s is an interpreted language, so your perl code runs without compilation.

Perl language Features:

  • Perl takes the best features from other languages, such as C, scripting tools like awk, sed, sh, and BASIC, among others.
  • Perls database integration interface (DBI) supports third-party databases like Oracle, Sybase, Postgres, MySQL and others.
  • Perl works with HTML, XML, and other mark-up languages.
  • Perl supports both procedural and object-oriented programming.
  • Perl is extensible. There are over 20,000 third party modules available from the Comprehensive Perl Archive Network (CPAN).

Perl for Web Server

How Perl Language is used by a Web Server? Answer is Apache server Perl’s mod_perl module allows the Apache web server to embed a Perl interpreter. Perl DBI Package required for web database integration.

Perl command options with their description

-d                  Run program under debugger

-l                   Specify @INC/#include directory

-T                  Enable tainting checks

-t                    Enable tainting warnings

-U                  Allow unsafe operations

-w                  Enable many useful warnings

-W                  Enable all warnings

-X                   Disable all warnings

-e program    Run program in single quote from command line

How to run a Perl script from Command line of Linux or UNIX Operating Systems.

Note: Every perl script should be saved with .pl extension.

$ perl script.pl

Perl Data Types

Scalar: Scalar is simple variable starting with $ sign, There is no difference in data type like string,integer as in other language.

Hashes: Hashe is variable starting with % sign. It used to store data in key value pair.

Arrays: Arrays is variable starting with @ sign.It used to store multiple scalar variable or objects.

Coming soon….In the next chapter release we will discuss the details of the data types and loop details.

 

 

SHARE

LEAVE A REPLY