Perl destructor not being called? Here's why
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:
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
This is a simple trick for conveniently running local Perl as a root user on UNIX-based systems.
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).
CPAN is a fantastic Perl resource with thousands of modules and new ones being added all the time. But how do you keep track of what’s being released? This article describes three techniques for keeping tabs on the latest CPAN releases.
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.
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.
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.
Another cool way to get the version of a module
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.