Perl (Practical Extraction and Reporting Language) is widely used open-source language. Read more
Foss : PERL - English
Outline: Access Modifiers in PERL
1. private variable - my
scope is in the block inside where it is declared
2. lexically scoped variables - local
that means they get the tem..
Outline: 1. Installation of Perl 5.14.2 on Ubuntu Linux
Installing XAMPP in Linux
(XAMPP is a cumulative package consisting of Apache, PERL, PHP and MySQL Packages is availabl..
Outline: Variables are used for storing values, like text strings, numbers or arrays
All variables in PERL start with a $ sign symbol
Declaring a variable in PERL: $var_name = value;
Outline: Comments in Perl
Two types of comments -
1. Single Line
2. Multi Line
Single Line comment starts with the symbol #
Multi Line comment used to comment a chunk of cod..
1. for Loop
for loop is used to execute a piece of code for certain number of times
2. for-each Loop
for-each loop is used to iterate a condition over an a..
Outline: 1. while Loop
while loop executes a block of code while a condition is true.
2. do-while loop
do-while loop will always execute the piece of code at-least once.
It will then..
Outline: if conditional statement is used to test some condition and if that condition is satisfied then execute the piece of code.
if-else conditional statement is used to test some condi..
Outline: if-elsif-else conditional statement is used to check specific condition and if it is true execute the respective block else execute the default else block.
switch is conditional c..
Outline: Perl provides 3 types of data structures.
This is the basic data structure in PERL.
It is as good as defining variables in Perl.
e.g $variable = 9;
Outline: 1. Getting Last index of array
2. Getting length of an array
To get the length, add 1 to last index of an array
Other way is use scalar function on array or a..
Add element at the end of an array
Remove element from the end of an array
Add element at the start of an array
Outline: 1. Accessing element of a hash
2. Basic hash functions
Returns keys of a hash
Returns values of a hash
Outline: 1. Simple function
2. Function with parameters
3. Function which return single value
4. Function which returns multiple values
Outline: Special Blocks
This block executes at the compilation time once it is defined.
Anything which needs to be included before execution of the rest of the code is wr..
Create a reference by adding \ (backward slash)
Demo of various examples
Add, remove, access elements of array reference / hash reference in the script with example..
Outline: 1. Special variables have a predefined and special meaning in Perl.
2. These variables are denoted by usual variable indicator such as $, @, % along with punctuation chara..
Outline: File Handling
1. Open a File
2. Open a File in Read Mode
3. Open a File in Write Mode
4. Open a File in Append Mode
5. Close the FileHandle
Outline: Exception and error handling
When an error occurs, exception and error handling helps to recover the program.
Methods used in Perl:
Outline: Including Files or modules in Perl program
We can include the Perl modules or files by using the following methods.
1. do: It includes the source code from other files into t..
Outline: Sample Perl program
We have included all the major topics we covered so far in this sample program.
This program will give the output of various weather forecast reports of a..
Click here to view stats
Spoken Tutorial by IIT Bombay is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.Based on a work at http://spoken-tutorial.org. Permissions beyond the scope of this license may be available at http://spoken-tutorial.org.