Interview: Trying to Catch Paul "LeoNerd" Evans
The prolific CPAN and Perl core developer talks about exceptions and other Perl topics.
The prolific CPAN and Perl core developer talks about exceptions and other Perl topics.
The change I would most like to see in Perl 5, and why it might not happen
PPI::Prettify makes pretty-printing Perl code as HTML easy
Add subroutine signatures to Perl
Perl is remarkably flexible and allows you to achieve all kinds of wizardry with the language. One example of this is using a dereferencing block to use a scalar value as a variable name. This allows you to use variables with dynamic names.
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: logical test ? value if true : value if false.
A popular way to build a list of literal quotes in Perl is to use the quote whitespace operator (qw). It’s terse, versatile and elegant. To see why, let’s look at a typical statement using a list of strings:
Arrays in Perl contain an ordered list of values that can be accessed using built-in functions. They are one of the most useful data structures and frequently used in Perl programming.
A typical way to print every element of an array in Perl is using a foreach loop:
Perl has many string functions, let’s take a look at a some of the most common ones: concatenate, substring and split.
Most Perl programmers know that to find the size of an array, the array must called in a scalar context like this:
Perl 5.14 adds non-destructive substitution.