Quantcast
Channel: Perl – Nicholas Dille
Browsing latest articles
Browse All 19 View Live

Perl Module Carp

… helps producing error messages. Import: use Carp; Warn of errors from perspective of caller: carp "MESSAGE"; Die of errors from perspective of caller: cluck "MESSAGE"; Warn of errors with stack...

View Article


Perl Module Data::Dumper

This modules visualizes data structures: [crayon-55e906c70ee16932576292/] The post Perl Module Data::Dumper appeared first on Nicholas Dille.

View Article


Perl Super-Methods

When writing object oriented code, you will most certainly have stumbled across the problem of calling super method explicitly. That need might arise if you have overwritten such a method in the...

View Article

Perl Dynamic Code Considerations

There isn’t very much to be said about that. During my work on one of my perl projects, I started playing with both function references and eval blocks. I noticed a significant increase in overall...

View Article

Check for Perl Module

Sometimes you’ll need to decide on a course of action depending on the presence of a certain module. The way you’d usually pull in a module: use MODULE qw(SYMBOLS); Instead of pulling in the module:...

View Article


Perl Subroutine References

If you are planning to use dynamically added code in your program, you should not rely on eval because it is several times slower than adding a subroutine: [crayon-55e906c70e102764553998/] The post...

View Article

Adding Perl Methods during Runtime

Since perl objects are blessed references, it is not easy to add an instance method which is visible in one single instance. NOTE: Please read and understand the note about adding functions. But you...

View Article

Multiple Inheritance in Perl

Ain’t no big deal, right? Have a look at Library::Class for a more universal approach. The post Multiple Inheritance in Perl appeared first on Nicholas Dille.

View Article


Active Directory Name to Distinguished Name Conversion

This note demonstrates some exciting Perl magic. It presents several ways to convert a directory-like name of an object in Active Directory to a X.500 Distonguished name. The script is interrupted by...

View Article


Child Processes

The following code snipplet defines two functions: childrenOf: Accepts a process ID and produces a list of child process IDs. Usage: PIDS="$(childrenOf ${SOME_PID})" allChildrenOf: Recursively produces...

View Article
Browsing latest articles
Browse All 19 View Live