This book is free!

Perl and Its Community

Perl 5's greatest accomplishment is the huge amount of reusable libraries developed for it. Where Perl 4 had forks to connect to databases such as Oracle and Sybase, for example, Perl 5 had a real extension mechanism. Larry wanted people to create and maintain their own extensions without fragmenting Perl into thousands of incompatible pidgins—and it worked.

That technical accomplishment was almost as important as the growth of a community around Perl 5. People write libraries. People build on the work of other people. People make a community worth joining and preserving and expanding.

The Perl community is strong and healthy. It welcomes willing participants at all levels, from novices to core developers. Take advantage of the knowledge and experience of countless other Perl programmers, and you'll become a better programmer.

The CPAN

Perl 5 is a pragmatic language on its own, yet the ever-pragmatic Perl community has extended that language and made their work available to the world. If you have a problem to solve, chances are someone's already written—and shared—Perl code for it.

Modern Perl programming makes heavy use of the CPAN (http://www.cpan.org/). The Comprehensive Perl Archive Network is an uploading and mirroring system for redistributable, reusable Perl code. It's one of—if not the—largest archives of libraries of code in the world. The CPAN offers libraries for everything from database access to profiling tools to protocols for almost every network device ever created to sound and graphics libraries and wrappers for shared libraries on your system.

Modern Perl without the CPAN is just another language. Modern Perl with the CPAN is amazing.

CPAN mirrors distributions, or collections of reusable Perl code. A single distribution can contain one or more modules, or self-contained libraries of Perl code. Each distribution occupies its own CPAN namespace and provides unique metadata.

The CPAN is Big, Really Big

The CPAN adds hundreds of registered contributors and thousands of indexed modules in hundreds of distributions every month. Those numbers do not take into account updates. In late November 2011, search.cpan.org reported 9359 uploaders, 101656 modules, and 23808 distributions (representing growth rates of 11.5%, 19.4%, and 14.3% since the previous edition of this book, respectively).

The CPAN itself is merely a mirroring service. Authors upload distributions and the CPAN sends them to mirror sites, from which users and CPAN clients download, configure, build, test, and install them. The system succeeds because of this simplicity as well as the contributions of thousands of volunteers who've built on this distribution system. In particular, community standards have evolved to identify the attributes and characteristics of well-formed CPAN distributions. These include:

Standards for automated CPAN installers.

Standards for metadata to describe what each distribution provides and expects.

Standards for documentation and licensing.

Additional CPAN services provide comprehensive automated testing and reporting to improve the quality of packaging and correctness across platforms and Perl versions. Every CPAN distribution has its own ticket queue on http://rt.cpan.org/ for reporting bugs and working with authors. CPAN sites also link to previous distribution versions, module ratings, documentation annotations, and more. All of this is available from http://search.cpan.org/.

Modern Perl installations include two clients to connect to, search, download, build, test, and install CPAN distributions, CPAN.pm and CPANPLUS. For the most part, each of these clients is equivalent for basic installation. This book recommends the use of CPAN.pm solely due to its ubiquity. With a recent version (as of this writing, 1.9800 is the latest stable release), module installation is reasonably easy. Start the client with:

Even though the CPAN client is a core module for the Perl 5 distribution, you will likely need to install standard development tools such as a make utility and possibly a C compiler. Windows users, see Strawberry Perl (http://strawberryperl.com/) and Strawberry Perl Professional. Mac OS X users must install XCode. Unix and Unix-like users often have these tools available (though Debian and Ubuntu users should install build-essential).

CPAN Management Tools

If your operating system provides its own installation of Perl 5, that version may be out of date or it may have its own dependencies on specific versions of CPAN distributions. Serious Perl developers often construct virtual walls between the system Perl and their development Perl installations. Several projects help to make this possible.

App::cpanminus is a relatively new CPAN client with goals of speed, simplicity, and zero configuration. Install it with cpan App::cpanminus, or:

$ curl -LO http://xrl.us/cpanm
$ chmod +x cpanm

App::perlbrew is a system to manage and to switch between your own installations of multiple versions and configurations of Perl. Installation is as easy as:

The local::lib CPAN distribution allows you to install and to manage distributions in your own user directory, rather than for the system as a whole. This is an effective way to maintain CPAN distributions without affecting other users. Installation is somewhat more involved than the previous two distributions, though App::local::lib::helper can simplify the process. See http://search.cpan.org/perldoc?local::lib and http://search.cpan.org/perldoc?App::local::lib::helper for more details.

All three projects tend to assume a Unix-like environment (such as a GNU/Linux distribution or even Mac OS X). Windows users, see the Padre all-in-one download (http://padre.perlide.org/download.html).

Community Sites

Perl's homepage at http://www.perl.org/ links to Perl documentation, source code, tutorials, mailing lists, and several important community projects. If you're new to Perl, the Perl beginners mailing list is a friendly place to ask novice questions and get accurate and helpful answers. See http://learn.perl.org/faq/beginners.html.

PerlMonks, at http://perlmonks.org/, is a community site devoted to discussions about Perl programming. Its eleven year history makes it one of the most venerable question and answer sites for any programming language.

Several community sites offer news and commentary. http://blogs.perl.org/ is a free blog platform open to any Perl community member.

Perl Buzz (http://perlbuzz.com/) collects and republishes some of the most interesting and useful Perl news on a regular basis. Perl Weekly (http://perlweekly.com/) offers a weekly take on news from the Perl world.

Development Sites

Best Practical Solutions (http://bestpractical.com/) maintains an installation of their popular request tracking system, RT, for CPAN authors as well as Perl 5 and Perl 6 development. Every CPAN distribution has its own RT queue, linked from search.cpan.org and available on http://rt.cpan.org/. Perl 5 and Perl 6 have separate RT queues available on http://rt.perl.org/.

Events

The Perl community holds countless conferences, workshops, seminars, and meetings. In particular, the community-run YAPC—Yet Another Perl Conference—is a successful, local, low-cost conference model held on multiple continents. See http://yapc.org/.

Hundreds of local Perl Mongers groups get together frequently for technical talks and social interaction. See http://www.pm.org/.

IRC

When Perl mongers can't meet in person, many collaborate and chat online through the textual chat system known as IRC. Many of the most popular and useful Perl projects have their own IRC channels, such as #moose and #catalyst.

The main server for Perl community is irc://irc.perl.org/. Notable channels include #perl-help, for general assistance on Perl programming, and #perl-qa, devoted to testing and other quality issues. Be aware that the channel #perl is a general purpose channel for discussing whatever its participants want to discuss ... and, as such, it's not primarily a helpdesk..