perl-begin / lib / tutorials / modern-perl / xhtml / chapter_00.html

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<h1 id="heading_id_2">*Preface</h1>
<p><em>Modern Perl</em> is one way to describe the way the world's most effective Perl 5 programmers work. They use language idioms. They take advantage of the CPAN. They show good taste and craft to write powerful, maintainable, scalable, concise, and effective code. You can learn these skills too!</p>
<p>Perl first appeared in 1987 as a simple tool for system administration. Though it began by declaring and occupying a comfortable niche between shell scripting and C programming, it has become a powerful, general-purpose language family. Perl 5 has a solid history of pragmatism and a bright future of polish and enhancement <span class="footnote">(footnote: Perl 6 is a reinvention of programming based on the solid principles of Perl, but it's a subject of another book.)</span>.</p>
<p>Over Perl's long history--especially the 17 years of Perl 5--our understanding of what makes great Perl programs has changed. While you can write productive programs which never take advantage of all the language has to offer, the global Perl community has invented, borrowed, enhanced, and polished ideas and made them available to anyone willing to learn them.</p>
<h2 id="heading_id_3">Running Modern Perl</h2>
<p>The <code>Modern::Perl</code> module from the CPAN (<a href="chapter_02.html#cpan">The CPAN</a>(cpan)) asks Perl to warn of dubious constructs and typos and will enable new features introduced in modern releases of Perl 5. Unless otherwise mentioned, code snippets always assume the basic skeleton of a program:</p>
<div class="programlisting">
<code>    #!/usr/bin/env perl

    use Modern::Perl 2011;
    use autodie;</code>
<p>... which is equivalent to:</p>
<div class="programlisting">
<code>    #!/usr/bin/env perl

    use 5.012;      # implies "use strict;"
    use warnings;
    use autodie;</code>
<p>Some examples use testing functions such as <code>ok()</code>, <code>like()</code>, and <code>is()</code> (<a href="chapter_09.html#testing">Testing</a>(testing)). These programs follow the pattern:</p>
<div class="programlisting">
<code>    #!/usr/bin/env perl

    use Modern::Perl;
    <strong>use Test::More;</strong>

    # example code here

<p>At the time of writing, the current stable Perl 5 release family is Perl 5.14. The examples in this book work best with Perl 5.12.0 or newer. Many examples will work on older versions of Perl 5 with modest changes, but you will have more difficulty with anything older than 5.10.0.</p>
<div id="iStrawberry_Perl_0"></div>
<div id="iActivePerl_0"></div>
<div id="iperlbrew_0"></div>
<div id="iCPAN__iApp5858perlbrew_0"></div>
<p>If you have no Perl 5 installed (or if you have an old version installed), you can install a newer release yourself. Windows users, download Strawberry Perl from <span class="url"></span> or ActivePerl from <span class="url"></span>. Users of other operating systems with Perl 5 already installed (and a C compiler and the other development tools), start by installing the CPAN module <code>App::perlbrew</code> <span class="footnote">(footnote: See <span class="url"></span> for installation instructions.)</span>.</p>
<p><code>perlbrew</code> allows you to install and manage multiple versions of Perl 5. This allows you to switch between versions of Perl 5 as well as to install Perl 5 and CPAN modules in your home directory without affecting the system's version. If you've ever had to beg your system administrator for permission to install software, you know how much easier your life can be now.</p>
<h2 id="heading_id_4">Credits</h2>
<p>This book would not have been possible without questions, comments, suggestions, advice, wisdom, and encouragement from many, many people. In particular, the author and editor thank:</p>
<div id="credits"></div>
John SJ Anderson, Peter Aronoff, Lee Aylward, Alex Balhatchet, Ævar Arnfjörð Bjarmason, Matthias Bloch, John Bokma, Vasily Chekalkin, Dmitry Chestnykh, E. Choroba, Tom Christiansen, Anneli Cuss, Paulo Custodio, Steve Dickinson, Kurt Edmiston, Felipe, Shlomi Fish, Jeremiah Foster, Mark Fowler, John Gabriele, Andrew Grangaard, Bruce Gray, Ask Bjørn Hansen, Tim Heaney, Graeme Hewson, Robert Hicks, Michael Hind, Mark Hindess, Yary Hluchan, Daniel Holz, Mike Huffman, Gary H. Jones II, Curtis Jewell, Mohammed Arafat Kamaal, James E Keenan, Kirk Kimmel, Yuval Kogman, Jan Krynicky, Michael Lang, Jeff Lavallee, Moritz Lenz, Andy Lester, Jean-Baptiste Mazon, Josh McAdams, Gareth McCaughan, John McNamara, Shawn M Moore, Alex Muntada, Carl Mäsak, Chris Niswander, Nelo Onyiah, Chas. Owens, ww from PerlMonks, Jess Robinson, Dave Rolsky, Gabrielle Roth, Jean-Pierre Rupp, Eduardo Santiago, Andrew Savige, Lorne Schachter, Steve Schulze, Dan Scott, Alexander Scott-Johns, Phillip Smith, Christopher E. Stith, Mark A. Stratman, Bryan Summersett, Audrey Tang, Scott Thomson, Ben Tilly, Ruud H. G. van Tol, Sam Vilain, Larry Wall, Lewis Wall, Colin Wetherbee, Frank Wiegand, Doug Wilson, Sawyer X, David Yingling, Marko Zagozen, harleypig, hbm, and sunnavy.
<p>Any remaining errors are the fault of the stubborn author.</p>