Use the logical-or and defined-or operators to provide default subroutine variable behaviour
Perl subroutines do not have signatures so variables must be initialized and arguments assigned to them inside the subroutine code. This article describes two useful shortcuts that can simplify this process.
The conditional (ternary) operator
One way to reduce the verbosity of Perl code is to replace if-else statements with a conditional operator expression. The conditional operator (aka ternary operator) takes the form: <b>logical test</b> ? <b>value if true</b> : <b>value if false</b>.
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.