Basics of perl
- Perl is a stable, cross platform programming language.
- Though Perl is not officially an acronym but few people used it asPractical Extraction and Report Language.
- It is used for mission critical projects in the public and private sectors.
- Perl is an Open Source software, licensed under its Artistic License, or the GNU General Public License (GPL).
Conditional statements
if statement
An if statement consists of a boolean expression followed by one or more statements.
if else statement
An if statement can be followed by an optional else statement.
elsif statement
An if statement can be followed by an optional elsif statement and then by an optional else statement.
Loops
For loop
Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
While loop
The while loop executes a block of code as long as the specified condition is true.
do...while loop
Like a while statement, except that it tests the condition at the end of the loop body.
String manipulation
Upper case ,lower case and length of string
The lc, uc, length are used to change the text to the lower case, upper case and length of the string respectively.
index of the string
The index method is used to find the index of the string.
substr of the string
The substr method is used to divide the string into required number of parts.
Replacing the string
The substr method is also used to replace the string with the other by syntax given below.
No comments:
Post a Comment