📄 ch27_01.htm
字号:
<html><head><title>Perl Culture (Programming Perl)</title><!-- STYLESHEET --><link rel="stylesheet" type="text/css" href="../style/style1.css"><!-- METADATA --><!--Dublin Core Metadata--><meta name="DC.Creator" content=""><meta name="DC.Date" content=""><meta name="DC.Format" content="text/xml" scheme="MIME"><meta name="DC.Generator" content="XSLT stylesheet, xt by James Clark"><meta name="DC.Identifier" content=""><meta name="DC.Language" content="en-US"><meta name="DC.Publisher" content="O'Reilly & Associates, Inc."><meta name="DC.Source" content="" scheme="ISBN"><meta name="DC.Subject.Keyword" content=""><meta name="DC.Title" content="Perl Culture"><meta name="DC.Type" content="Text.Monograph"></head><body><!-- START OF BODY --><!-- TOP BANNER --><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home"><map name="banner-map"><AREA SHAPE="RECT" COORDS="0,0,466,71" HREF="index.htm" ALT="Programming Perl"><AREA SHAPE="RECT" COORDS="467,0,514,18" HREF="jobjects/fsearch.htm" ALT="Search this book"></map><!-- TOP NAV BAR --><div class="navbar"><table width="515" border="0"><tr><td align="left" valign="top" width="172"><a href="ch26_05.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="part4.htm">Part 4: Perl as Culture</a></td><td align="right" valign="top" width="172"><a href="ch27_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr></table></div><hr width="515" align="left"><!-- SECTION BODY --><h1 class="chapter">Chapter 27. Perl Culture</h1><div class="htmltoc"><h4 class="tochead">Contents:</h4><p><a href="ch27_01.htm">History Made Practical</a><br><a href="ch27_02.htm">Perl Poetry</a><br></p></div><p>This book is a part of Perl culture, so we can't hope to put everythingwe know about Perl culture in here. We can only whet your appetite with alittle history, and a little art--some would say "very little art". For amuch larger dose of Perl culture, see www.perl.org and www.perl.com. (Larry keeps copies of all his (official) ravings at www.wall.org/~larry.) Or just get acquainted with some other Perl programmers. We can't tell you what sort of people they'll be--about the only personality trait Perl programmers have in common is that they're all pathologically helpful.</p><h2 class="sect1">27.1. History Made Practical</h2><a name="INDEX-4381"></a><a name="INDEX-4382"></a><p>In order to understand why Perl is defined the way it is (or isn't), onemust first understand why Perl even exists. So, let's drag out the olddusty history book....</p><p>Way back in 1986, Larry was a systems programmer on a projectdeveloping multi-level-secure wide-area networks. He was in charge ofan installation consisting of three VAXen and three Suns on the WestCoast, connected over an encrypted, 1200-baud serial line to a similarconfiguration on the East Coast. Since Larry's primary job wassupport (he wasn't a programmer on the project, just the system guru),he was able to exploit his three virtues (laziness, impatience, andhubris) to develop and enhance all sorts of useful tools--such as<em class="emphasis">rn</em>, <em class="emphasis">patch</em>, and<em class="emphasis">warp</em>.<a href="#FOOTNOTE-1">[1]</a></p><blockquote class="footnote"><a name="FOOTNOTE-1"></a><p>[1] It was at about this timethat Larry latched onto the phrase "feeping creaturism" in a desperateattempt to justify on the basis of biological necessity hisoverwhelming urge to add "just one more feature". After all, if LifeIs Simply Too Complicated, why not programs too? Especially programslike <em class="emphasis">rn</em> that really ought to be treated asadvanced Artificial Intelligence projects so that they can read yournews for you. Of course, some people say that the<em class="emphasis">patch</em> program is already <em class="emphasis">too</em>smart.</p></blockquote><p>One day, after Larry had just finished ripping <em class="emphasis">rn</em>to shreds, leaving it in pieces on the floor of his directory, thegreat Manager came to him and said, "Larry, we need a configurationmanagement and control system for all six VAXen and all six Suns. Weneed it in a month. Go to it!"</p><p>So, Larry, never being one to shirk work, asked himself what was thebest way to have a bicoastal CM system, without writing it fromscratch, that would allow viewing of problem reports on both coasts,with approvals and control. The answer came to him in one word:B-news.<a href="#FOOTNOTE-2">[2]</a></p><blockquote class="footnote"><a name="FOOTNOTE-2"></a><p>[2]That is, the second implementation of Usenettransport software.</p></blockquote><p>Larry went off and installed news on these machines and added twocontrol commands: an "append" command to append to an existingarticle, and a "synchronize" command to keep the article numbers thesame on both coasts. CM would be done using RCS (Revision ControlSystem), and approvals and submissions would be done using news and<em class="emphasis">rn</em>. Fine so far.</p><p>Then the great Manager asked him to produce reports. News wasmaintained in separate files on a master machine, with lots ofcross-references between files. Larry's first thought was "Let's use<em class="emphasis">awk</em>." Unfortunately, the <em class="emphasis">awk</em>of that day couldn't handle opening andclosing of multiple files based on information in the files. Larrydidn't want to have to code a special-purpose tool. As a result, a newlanguage was born.</p><p>This new tool wasn't originally called Perl. Larry bandied about anumber of names with his officemates and cohorts (Dan Faigin, who wrotethis history, and Mark Biggar, his brother-in-law, who also helpedgreatly with the initial design). Larry actually considered andrejected every three- or four-letter word in the dictionary. One of theearliest names was "Gloria", after his sweetheart (and wife).He soon decided that this would cause too much domestic confusion.</p><p>The name then became "Pearl", which mutated into our present-day"Perl", partly because Larry saw a reference to another languagecalled PEARL, but mostly because he's too lazy to type five lettersall the time. And, of course, so that Perl could be used as afour-letter word. (You'll note, however, the vestiges of the formerspelling in the acronym's gloss: "Practical Extraction<em class="emphasis">And</em> Report Language".)</p><p>This early Perl lacked many of the features of today's Perl. Patternmatching and filehandles were there, scalars were there, and formatswere there, but there were very few functions, no associative arrays,and only a crippled implementation of regular expressions, borrowed from<em class="emphasis">rn</em>. The manpage was only 15 pages long. But Perlwas faster than <em class="emphasis">sed</em> and <em class="emphasis">awk</em>and began to be used on other applications on the project.</p><p><a name="INDEX-4383"></a><a name="INDEX-4384"></a>But Larry was needed elsewhere. Another great Manager came over oneday and said, "Larry, support R&D." And Larry said, okay. Hetook Perl with him and discovered that it was turning into a good toolfor system administration. He borrowed Henry Spencer's beautifulregular expression package and butchered it into something Henry wouldprefer not to think about during dinner. Then Larry added most of thegoodies he wanted, and a few goodies other people wanted. He releasedit on the network.<a href="#FOOTNOTE-3">[3]</a> The rest, as they say, ishistory.<a href="#FOOTNOTE-4">[4]</a></p><blockquote class="footnote"><a name="FOOTNOTE-3"></a><p>[3] More astonishingly, he kept onreleasing it as he went to work at Jet Propulsion Lab, then at NetLabsand Seagate. Nowadays, other people do most of the real work, andLarry pretends to work for O'Reilly & Associates (a small companythat publishes pamphlets about computers andstuff).</p></blockquote><blockquote class="footnote"><a name="FOOTNOTE-4"></a><p>[4] And this, so to speak, is a footnote tohistory. When Perl was started, <em class="emphasis">rn</em> had just beenripped to pieces in anticipation of a major rewrite. Since he startedwork on Perl, Larry hasn't touched <em class="emphasis">rn</em>. It isstill in pieces. Occasionally, Larry threatens to rewrite<em class="emphasis">rn</em> in Perl, but neverseriously.</p></blockquote><p>Which goes something like this: Perl 1.0 was released on December 18,1987; some people still take Perl's Birthday seriously. Perl 2.0follows in June 1988, and Randal Schwartz creates the legendary "JustAnother Perl Hacker" signature. In 1989, Tom Christiansen presentsthe first public Perl tutorial at the Baltimore Usenix. With Perl 3.0in October 1989, the language is released and distributed for thefirst time under the terms of the GNU Public License.</p><p>In March of 1990, Larry writes the first Perl Poem (see the followingsection). Then he and Randal write the first edition of this book,The Pink Camel; it is published in early 1991. Perl 4.0 is releasedsimultaneously; it includes an Artistic License as well as the GPL.</p><p>The unveiling of the much anticipated Perl 5 occurs in October 1994.A complete rewrite of Perl, it includes objects and modules. Theadvent of Perl 5 even merits coverage by <em class="emphasis">TheEconomist</em>. In 1995, CPAN is officially introduced to thePerl community. Jon Orwant begins publishing <em class="emphasis">The PerlJournal</em> in 1996. After a long gestation, the secondedition of this book, The Blue Camel, appears that fall. Thefirst O'Reilly Perl Conference (TPC) is held in San Jose, California,in the summer of 1997. Notable events are now occurring almost daily,so for the rest of history, check out the Perl Timeline on CPAST,the Comprehensive Perl Arcana Society Tapestry(<em class="emphasis">history.perl.org</em>).</p><!-- BOTTOM NAV BAR --><hr width="515" align="left"><div class="navbar"><table width="515" border="0"><tr><td align="left" valign="top" width="172"><a href="ch26_05.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0"></a></td><td align="right" valign="top" width="172"><a href="ch27_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr><tr><td align="left" valign="top" width="172">26.5. Documenting Your Perl Programs</td><td align="center" valign="top" width="171"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0"></a></td><td align="right" valign="top" width="172">27.2. Perl Poetry</td></tr></table></div><hr width="515" align="left"><!-- LIBRARY NAV BAR --><img src="../gifs/smnavbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links"><p><font size="-1"><a href="copyrght.htm">Copyright © 2001</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"> <area shape="rect" coords="2,-1,79,99" href="../index.htm"><area shape="rect" coords="84,1,157,108" href="../perlnut/index.htm"><area shape="rect" coords="162,2,248,125" href="../prog/index.htm"><area shape="rect" coords="253,2,326,130" href="../advprog/index.htm"><area shape="rect" coords="332,1,407,112" href="../cookbook/index.htm"><area shape="rect" coords="414,2,523,103" href="../sysadmin/index.htm"></map><!-- END OF BODY --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -