Old School Object Oriented Perl
If you need to write object oriented Perl code with no dependencies, then you need to use the old school Perl syntax. This article describes the main features of old school object oriented Perl including class declaration, constructors, destructors, methods, attributes, accessors and inheritance.
Test if the user is root
When Perl is executing a program, it maintains the user id of the process owner in a global variable ($<). When a Perl program is executed by root or a user with root privileges (e.g. using the sudo command), the user id variable is always set to zero. This can be checked at the command line:
Upgrade your list printing using field separator variables
A typical way to print every element of an array in Perl is using a foreach loop:
Repeat strings with the repetition operator Repeat strings with the repetition operator
You get the idea - Perl has a repetition operator (x) that repeats the scalar or list on its left by the number on it’s right (like multiplication).
Perl string functions - concatenate substring and split
Perl has many string functions, let’s take a look at a some of the most common ones: concatenate, substring and split.
Quoting strings in Perl - even ones containing apostrophes and quote or speech marks
Broadly speaking Perl has two types of strings: quotes that are interpolated at runtime and literal quotes that are not interpolated. Let’s review each of these in turn.
New Features of Perl 5.14: Non-destructive Substitution
Perl 5.14 adds non-destructive substitution.