Perl – Practical Extraction and Report Language is a free high-level, interpreted, dynamic programming language written by Larry Wall in the year 1987.Perl is very good for shell scripting and regualar expression.If you use GNU/Linux is default installed, on windows you have to install ActivePerl.The languages includes Perl 5 and 6, I use primary Perl 5(Perl 5 is also continue developing).The symbol of the Perl language is the Camel symbol.



$ for Scalar,@ for Array and % for Hashes, as example:

In Perl all variables are Scalars, you could store numbers and strings in the same value without convert.If you want to add a Scalar to another you have to concate two strings with “.”, but if you want to add two number you should use “+”.To access an element from the array you could use “$name[0]”, it starts from 0 to the last element, you get the last element with “$#name”.For manipulating a Perl Array look at this Post.And you could choose in  a big list of default variables.



Be careful with quoting, the double quotes could interpolate other Scalars.

The name1 is “1” and name2 is “$a”.



an simple “Hello World!” example:



To compare the Scalars you could use them from this table:

compare type number string
equal == eq
 not equal  != ne
 less than  <  lt
 greater than  >  gt
 less or equal  <=  le
 greater or equal  >=  ge



In Perl are more than one way to make a loop:

the first one is faster and faster to write, but the second has more possibility’s to change.

Do-While loop:

While loop:



Regular Expressions are very good implemented by Perl:



Perl is an interpreted language and if you need more performance you could use Inline code like C or you could take a look at my Benchmarks or at write fast code in Perl.


If you want to see some examples and solution from me see into my Category – Perl or if you want to see some special Tricks in Perl.

for loop Benchmark

This is a Perl Benchmark about the for loop with fix range and with a post increment that’s the fastest increment (Perl increment Benchmark):

Our result:

We see that we always should choose the for loop with a fixed range its possible.

Perl increment Benchmark

This is a Perl Benchmark about post-increment,pre-increment and a normal increment:

This is our result:

pre increment is the fastest because it have not to increment the value and return the old value.But the fastest is the fixed range, take a look at for loop Benchmark.The default is the slowest because it have to handle other steps.