Perl levels up with native subroutine signatures
The syntax, the benefits and what’s coming next
The syntax, the benefits and what’s coming next
A sneak peak at Perl v5.20’s most interesting change
Multi-core programming is a breeze with MCE
Think you know how to fix CRLF in one line of Perl? There might be more to it than you think …
Learn when and how to use this classic “gang of four” code pattern
Writing accessors in vanilla object oriented Perl doesn’t have to lead to verbose boilerplate code
Ever had a program crash and wanted to get more details about where and why? The CPAN module Carp::Always is perfect for this.
STDOUT is the Perl filehandle for printing standard output. Unless a filehandle is specified, all standard printed output in Perl will go to the terminal. Because STDOUT is just a global variable, it can be redirected and restored. Want to implement logging on a program without changing every print statement in the source code? Want to capture the standard output of a perl CRON job? Read on.
Perl’s split function has a useful feature that will split a string into characters. This works by supplying an empty regex pattern ("//") to the split function. This can be used to easily split a word into an array of letters, for example:
Add subroutine signatures to Perl
If you’re using a Perl destructor method (‘DESTROY’, ‘DEMOLISH’) it may not be called if the Perl process is terminated abruptly by a signal. To fix this, just add the sigtrap pragma to your program:
We show you how to listen for signals and handle them gracefully
Perl’s flexible syntax accepts all kinds of shenanigans and hackery. This article describes one such trick to call object methods without including the referent object (sort of).
An anonymous function in Perl is an unnamed subroutine. But what are they good for? This article shows how through using anonymous functions it’s possible to write more generic, re-usable Perl code.
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.
Hashes are one of Perl’s core data types. This article describes the main functions and syntax rules for for working with hashes in Perl.