Introduction to Perl - Perl Basics
Perl is a free programming language known for its ability to quickly
manipulate text files. It is used extensively by programmers on PCs
and UNIX machines to read, modify, and write text files and text-based
databases.
More importantly, Perl has
become the predominant server-based programming language for handling
text-based web pages and is used to accept user inputs (usually from
web page forms) and to use those inputs for real time database updates
and to return custom web pages to users.
The following three sections provide additional introductory information about Perl.
Perl is free, easy to learn, and continues to evolve to meet the
needs of web programmers.
Perl Basics
Here are a few fundamental details about Perl that you need to understand.
If you're already a programmer these may seem pretty basic but for
first time programmers these points seldom get mentioned.
- Free
Perl is free from ActiveState.
and other companies.
- Perl Installation
Perl was first made available for UNIX machines, is now available for Windows.
An installation of Perl consists of about 4000 files that take up about 35MB
of space. The files include not only the interpreter ("perl.exe") but also
documentation, utilities, libraries, and much more.
- No Compiler
Perl is an interpreted language. It does not come with a compiler which converts
the code to an EXE file.
- No IDE (Integrated Development Environment)
Perl does not come with a built-in code editor. Any text editor can be
used to Perl scripts. Notepad is often used.
- No GUI
Perl is a command line language. It has no graphical user interface.
This means that to run Perl, you operate in a DOS window on the PC
or at the command line in UNIX. This is very important because when
Perl is used on a web server at the request of a web site visitor,
no one is at the terminal to handle any graphical interaction.
- Perl Scripts
A Perl program is simply a text file in which you place commands that
the Perl interpreter executes at run time.
A Perl program is usually known as a "script" rather than as a
"program". This reflects the fact that Perl programs are interpreted
at run time rather than executed from a compiled version.
The file name can be anything you want. No specific extension is
required, although ".pl" and ".cgi" are commonly used.
- perl.exe
The Perl interpreter (the program that executes the Perl script)
is "perl.exe". To run a Perl program on a PC, simply type in:
perl filename
|