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:
A typical way to print every element of an array in Perl is using a foreach loop:
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 ships with a command-line program called perldoc that makes it easier to search and read Perl’s vast documentation in the POD markup language. If perldoc is called with the -F flag, it will display the POD markup of an input file - this can be useful when your are developing a new Perl distribution and want to check the appearance of the POD in your module before it appears on CPAN for all to see.
Perl has many string functions, let’s take a look at a some of the most common ones: concatenate, substring and split.
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.
Most Perl programmers know that to find the size of an array, the array must called in a scalar context like this:
Perl module features and behaviour can change from version to version and so knowing the version number of an installed Perl module can be useful in several scenarios. Below are three different command line methods for finding out the version number of an installed module that work on Bash and Windows Powershell. So fire up the terminal and get typing!