Skip to content

Commit

Permalink
Edited chapter 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromatic committed Aug 30, 2011
1 parent 45b52a8 commit a74cc0b
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 134 deletions.
27 changes: 12 additions & 15 deletions sections/chapter_02.pod
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
=head0 Perl and Its Community

One of Larry's main goals for Perl 5 was to encourage Perl development and
evolution outside the core distribution. Perl 4 had several forks, because
there was no easy way to connect it to a relational database, for example.
Larry wanted people to create and maintain their own extensions without
fragmenting Perl into thousands of incompatible pidgins.
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.

You can add technical mechanisms for extensions, but you must also consider
community aspects as well. Extensions and enhancements that no one shares are
extensions and enhancements that everyone has to build and test and debug and
maintain themselves. Yet shared extensions and libraries are worthless if you
can't find them, or you can't enhance them, or you don't have permission to use
them.
That technical accomplishment was almost important as the growth of a community
around Perl 5. I<People> write libraries. I<People> build on the work of other
people. I<People> make a community worth joining and preserving and expanding.

Fortunately, the Perl community exists. It's strong and healthy. It welcomes
willing participants at all levels--and not just for people who produce and
share code. Consider taking advantage of the knowledge and experience of
countless other Perl programmers, and sharing your abilities as well.
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.

L<perl_community>

Expand Down
145 changes: 67 additions & 78 deletions sections/cpan.pod
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,79 @@

Z<cpan>

Perl 5 is a pragmatic language. It'll help you get your work done. 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 uploaded code to the CPAN for it.

The line between a modern language and its libraries is fuzzy. Is a language
only syntax? Is it the core libraries? Is it the availability of external
libraries and the ease at which you can use them within your own projects?
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.

X<CPAN>

Regardless of how you answer those questions for any other language, modern
Perl programming makes heavy use of the CPAN (U<http://www.cpan.org/>). The
CPAN, or Comprehensive Perl Archive Network, is an uploading and mirroring
system for redistributable, reusable Perl code. It's one of--if not
I<the>--largest archives of libraries of code in the world.
Modern Perl programming makes heavy use of the CPAN (U<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 I<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.

X<distribution>
X<modules>

CPAN mirrors I<distributions>, which tend to be collections of reusable Perl
code. A single distribution can contain one or more I<modules>, or
self-contained libraries of Perl code. Each distribution lives in its own
namespace on the CPAN and contains its own metadata. You can build, install,
test, and update each distribution. Distributions may depend on other
distributions. For this reason, installing distributions through a CPAN client
is often simpler than doing so manually.
CPAN mirrors I<distributions>, or collections of reusable Perl code. A single
distribution can contain one or more I<modules>, or self-contained libraries of
Perl code. Each distribution occupies its own CPAN namespace and provides
unique metadata.

=begin sidebar

The CPAN I<adds> hundreds of registered contributors and thousands of indexed
modules in hundreds of distributions every month. Those numbers do not take
into account updates. At printing time in October 2010, search.cpan.org
reported 8465 uploaders, 86470 modules, and 21116 distributions.
modules in hundreds of distributions every month. Those numbers do not take
into account updates. In late August 2011, search.cpan.org reported 9171
uploaders, 99011 modules, and 23260 distributions.

=end sidebar

X<search.cpan.org>

The CPAN itself is merely a mirroring service. Authors upload distributions
containing modules, and the CPAN sends them to mirror sites, from which users
and CPAN clients download, configure, build, test, and install distributions.
Yet the CPAN has succeeded because of this simplicity, and because of the
contributions of thousands of volunteers who've built on this distribution
system to produce something greater. In particular, community standards have
evolved to identify the attributes and characteristics of well-formed CPAN
distributions. These include:
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:

=over 4

=item Standards for installation to work with automated CPAN installers.
=item Standards for automated CPAN installers.

=item Standards for metadata to describe what each distribution includes and
any dependencies of the distribution.
=item Standards for metadata to describe what what each distribution provides
and expects.

=item Standards for documentation and licensing to describe what the
distribution does and how you may use it.
=item Standards for documentation and licensing.

=back

Additional CPAN services provide comprehensive automated testing and reporting
of every CPAN distribution for adherence to packaging and distribution
guidelines and correctness of behavior on various platforms and versions of
Perl. Every CPAN distribution has its own ticket queue on
U<http://rt.cpan.org/> for reporting bugs and working with authors.
Distributions also have historical versions available on the CPAN, ratings,
annotations for the documentation, and other useful information. All of this
is available from U<http://search.cpan.org/>.
to improve the quality of packaging and correctness across platforms and Perl
versions. Every CPAN distribution has its own ticket queue on
U<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
U<http://search.cpan.org/>.

X<CPAN; C<CPAN.pm>>
X<CPAN; C<CPANPLUS>>

Modern Perl installations include two clients to connect to, search, download,
build, test, and install CPAN distributions, CPAN.pm and CPANPLUS. They behave
equivalently; their use is a matter of taste. This book recommends the use of
CPAN.pm solely due to its ubiquity.

If you use a recent version of CPAN.pm (as of this writing, 1.9402 is the
latest stable release), CPAN.pm configuration is largely decision-free. For
any complete installation of Perl, you may start the client with:
build, test, and install CPAN distributions, CPAN.pm and CPANPLUS. A newer
alternative is also available, though it is not part of the core distribution.
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:

=begin programlisting

Expand All @@ -106,46 +99,42 @@ includes a great troubleshooting section.
=begin sidebar

Even though the CPAN client is a core module for the Perl 5 distribution, you
may also have to install standard development tools such as a C<make> utility
and possibly a C compiler to install all of the distributions you want.
Windows users, see Strawberry Perl (U<http://strawberryperl.com/>) and
Strawberry Perl Professional. Mac OS X users need their developer tools
installed. Unix and Unix-like users, consult your local system administrator.
will likely need to install standard development tools such as a C<make>
utility and possibly a C compiler. Windows users, see Strawberry Perl
(U<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 C<build-essential>).

=end sidebar

For your work setting up a CPAN client and an environment to build and install
distributions, you get access to 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.

=head2 CPAN Management Tools

Serious Perl developers often manage their own Perl library paths or even full
installations. Several projects help to make this possible.
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.

C<App::cpanminus> is a new CPAN client with goals of speed, simplicity, and
zero configuration. Installation is as easy as:
C<App::cpanminus> is a relatively new CPAN client with goals of speed,
simplicity, and zero configuration. Install it with C<cpan App::cpanminus>, or:

=begin programlisting

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

=end programlisting

C<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:
installations of multiple versions and configurations of Perl. Installation is
as easy as:

=begin programlisting

$ curl -LO http://xrl.us/perlbrew
$ chmod +x perlbrew
$ ./perlbrew install
$ perldoc App::perlbrew
$ B<curl -LO http://xrl.us/perlbrew>
$ B<chmod +x perlbrew>
$ B<./perlbrew install>
$ B<perldoc App::perlbrew>

=end programlisting

Expand All @@ -154,10 +143,10 @@ X<CPAN; App::local::lib::helper>

The C<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 C<App::local::lib::helper> can simplify.
See U<http://search.cpan.org/perldoc?local::lib> and
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 C<App::local::lib::helper> can simplify. See
U<http://search.cpan.org/perldoc?local::lib> and
U<http://search.cpan.org/perldoc?App::local::lib::helper> for more details.

All three distributions projects tend to assume a Unix-like environment (such
Expand Down
Loading

0 comments on commit a74cc0b

Please sign in to comment.