Presentation is loading. Please wait.

Presentation is loading. Please wait.

Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.

Similar presentations


Presentation on theme: "Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to."— Presentation transcript:

1 Perl Ed Finegan

2 Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to a lesser extent from sed, awk, the Unix shell, and many others. Perl's process, file, and text manipulation facilities make it particularly well-suited for tasks involving quick prototyping, system utilities, software tools, system management tasks, database access, and world wide web programming. These strengths make it especially popular with system administrators and CGI script authors. Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to a lesser extent from sed, awk, the Unix shell, and many others. Perl's process, file, and text manipulation facilities make it particularly well-suited for tasks involving quick prototyping, system utilities, software tools, system management tasks, database access, and world wide web programming. These strengths make it especially popular with system administrators and CGI script authors.

3 Perl’s Strengths Perl’s motto, “There's more then one way to do it in Perl!” This means you can program how you think. Perl’s motto, “There's more then one way to do it in Perl!” This means you can program how you think. Perl has excellent tools for handling textual data. Perl has excellent tools for handling textual data. Since Perl in an interpreted language it is easier to write code and test it since the step of compiling can be skipped. Since Perl in an interpreted language it is easier to write code and test it since the step of compiling can be skipped.

4 Perl’s Weaknesses “There's more then one way to do it in Perl!” This means that Perl code can be hard to read since everyone can write the same thing in many different ways. “There's more then one way to do it in Perl!” This means that Perl code can be hard to read since everyone can write the same thing in many different ways. Perl is not well suited for real time systems, or very large and complex projects. Perl is not well suited for real time systems, or very large and complex projects. Perl’s flexibility can make it hard to debug. Perl’s flexibility can make it hard to debug.

5 Perl’s Programming Paradigm Perl is an imperative language like C and C++. Perl is an imperative language like C and C++. It is possible to program object-oriented in perl but like C++, and unlike Java it is not mandatory. It is possible to program object-oriented in perl but like C++, and unlike Java it is not mandatory.

6 Perl & Data Types There are 3 data types in Perl There are 3 data types in Perl Scalar Scalar An individual value An individual value Defined by $ Defined by $ Array Array A list of values, keyed by numbers A list of values, keyed by numbers Defined by @ Defined by @ Hash Hash A group of values, keyed by strings A group of values, keyed by strings Defined by % Defined by %

7 Declaring Variables Variables can be declared like in C & C++, or just used Variables can be declared like in C & C++, or just used It is also possible to force all variables to be declared with ‘use strict’ It is also possible to force all variables to be declared with ‘use strict’ Variables such as a scalar can handle numbers and strings and switch between them when it is needed Variables such as a scalar can handle numbers and strings and switch between them when it is needed Example 1.1 Example 1.1 Example 1.1 Example 1.1

8 Scope of Variables Variables are global by default Variables are global by default Variables declared with ‘my’ have lexical scope Variables declared with ‘my’ have lexical scope Variables declared with ‘local’ are global Variables declared with ‘local’ are global Example 2.1 Example 2.1 Example 2.1 Example 2.1 Example 2.2 Example 2.2 Example 2.2 Example 2.2 Example 2.3 Example 2.3 Example 2.3 Example 2.3

9 Perl Control Constructs Perl’s control constructs are very close to C & C++ Perl’s control constructs are very close to C & C++ It has very similar if, else, elseif, while, untill, and for control constructs It has very similar if, else, elseif, while, untill, and for control constructs Perl has a few control constructs that are different then in C & C++ Perl has a few control constructs that are different then in C & C++ foreach foreach foreach $scalar (@array) foreach $scalar (@array) Foreach places an item into the scalar and runs though the loop then places the next and continues Foreach places an item into the scalar and runs though the loop then places the next and continues Example 3.1 Example 3.1 Example 3.1 Example 3.1

10 http://www.d229.com/~ed/perl/?PL


Download ppt "Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to."

Similar presentations


Ads by Google