Perl Programming Language
Last Updated :
12 Jun, 2024
Improve
Perl is a general purpose, high level interpreted and dynamic programming language. Perl supports both the procedural and Object-Oriented programming. Perl is a lot similar to C syntactically and is easy for the users who have knowledge of C, C++. Since Perl is a lot similar to other widely used languages syntactically, it is easier to code and learn in Perl. Programs can be written in Perl in any of the widely used text editors like Notepad++, gedit, etc.
Table of Content
- Basics
- Fundamentals
- Input and Output
- Use of print() and say() in Perl
- Control Flow
- Decision Making
- Datatypes
- Strings
- Object Oriented Programming in Perl
- Introduction to OOPs
- Subroutines
- Regular Expressions
- Regular Expressions
- File Handling
- File Handling Introduction
- Context Sensitivity
- Scalar Context Sensitivity
- CGI Programming
- CGI Programming
- Misc
Basics
- Introduction to Perl
- Installation and Environment Setup
- Syntax of a Perl Program
- Hello World Program in Perl
- Perl vs C/C++
- Perl vs Java
- Perl vs Python
Fundamentals
- Modes of Writing a Perl Code
- Boolean Values
- Operators | Set – 1, Set – 2
- Variables
- Variables and its Types
- Scope of Variables
- Modules in Perl
- Packages in Perl
- Number and its Types
- Directories with CRUD operations
Input and Output
Use of print() and say() in Perl
Control Flow
Decision Making
Datatypes
- Data Types
- Arrays and Lists:
- Hash:
- Scalars:
Strings
- Quoted, Interpolated and Escaped Strings
- Multi-line Strings | Here Document
- Sorting mixed Strings in Perl
- String Operators
- Useful String Operators
- String functions (length, lc, uc, index, rindex)
- Useful String functions
- Automatic String to Number Conversion or Casting
- Count the frequency of words in text
- Removing leading and trailing white spaces (trim)
Object Oriented Programming in Perl
Introduction to OOPs
- Classes
- Objects
- Methods
- Constructors and Destructors
- Method Overriding
- Inheritance
- Polymorphism
- Encapsulation
Subroutines
- Subroutines or Functions | Set – 1, Set – 2
- Function Signature in Perl
- Passing Complex Parameters to a Subroutine
- Mutable and Immutable parameters
- Multiple Subroutines
- Use of return() Function
- References
- Pass By Reference
- Recursion in Perl
Regular Expressions
Regular Expressions
- Operators in Regular Expression
- Regex Character Classes
- Special Character Classes in Regular Expressions
- Quantifiers in Regular Expression
- Backtracking in Regular Expression
- ‘e’ modifier in Regex
- ‘ee’ Modifier in Regex
- pos() function in Regex
- Regex Cheat Sheet
- Searching in a File using regex
File Handling
File Handling Introduction
- Opening and Reading a File
- Writing to a File
- Appending to a File
- Reading a CSV File
- File Test Operators
- File Locking
- Use of Slurp Module
- Useful File-handling functions
Context Sensitivity
Scalar Context Sensitivity
CGI Programming
CGI Programming
Misc
- Breakpoints of a Debugger
- Exiting from a Script
- Creating Excel Files
- Reading Excel Files
- Number Guessing Game using Perl
- Database management using DBI
- Accessing a Directory using File Globbing
- Use of Hash bang or Shebang line
- Useful Math functions