perl-MDK-Common tutorial v0.1

Guillaume Cottenceau


Introduction

This document aims at helping people interested in learning more on perl-MDK-Common, a Perl library which is intensively used in MandrakeSoft in-house software development.

The library adds some convenient "basic" functions to Perl, allows easier functional-style programming, and also provides some better system-related operations. It can be seen as an extension to the standard Perl library, adding missing helpful functions. It is divided as follows:

Thanks to perl-MDK-Common's own documentation, an easy way to directly access information about the provided functions, you can use perldoc, for example perldoc MDK::Common::Func will explain the functions of the Func module. Use perldoc MDK::Common to view information on all the available functions.

Additionally, perl-MDK-Common provides a binary called perl_checker, which is a Perl compiler aiming at enforcing the use of a subset of Perl, so that all MandrakeSoft Perl programs roughly follow the same code style. It will also help the programmer to remove unneeded parentheses and conditionals.


Prerequisites

Of course, a first look at the Perl language will be necessary for the reader. The following can be a good Perl Tutorial (though there are many of them on the web): http://www.comp.leeds.ac.uk/Perl/.

Programming with perl-MDK-Common also emphasizes the following quality properties on your code:

We can't discuss Perl programming without referring to two excellent books from O'Reilly. The first one is called "The Perl Cookbook", and covers many daily problems a Perl programmer will face, in a recipe-like fashion. All Perl programmers should own this book :). The second one can be a good resource for more skillful programmers, and is called "Advanced Perl Programming"; it covers interesting advanced features of Perl.


Structure of this document

This document will first try to emphasize the most useful functions of the perl-MDK-Common library, e.g. the most commonly used and simple. Then, some functions whose use is not trivial will be explained. As a last part, an introduction to the code-style to please perl_checker will be shown.


Most useful functions

Note: many functions' name, extending capabilities of existing functions, or being their functional counterpart, are suffixed with the underscore character (_); for example, chomp_ is the equivalent of chomp, but returns the chomp'ed results instead of modifying its argument.


Other interesting functions

The following describes functions whose use is not trivial.


perl_checker


Last update: Fri Apr 18 22:08:06 2003