⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prf2_01.htm

📁 By Tom Christiansen and Nathan Torkington ISBN 1-56592-243-3 First Edition, published August 1998
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<HTML><HEAD><TITLE>Preface (Perl Cookbook)</TITLE><METANAME="DC.title"CONTENT="Perl Cookbook"><METANAME="DC.creator"CONTENT="Tom Christiansen &amp; Nathan Torkington"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1999-07-02T01:27:41Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-243-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="index.htm"TITLE="Perl Cookbook"><LINKREL="prev"HREF="prf1_01.htm"TITLE="Foreword"><LINKREL="next"HREF="prf2_02.htm"TITLE="Platform Notes"></HEAD><BODYBGCOLOR="#FFFFFF"><img alt="Book Home" border="0" src="gifs/smbanner.gif" usemap="#banner-map" /><map name="banner-map"><area shape="rect" coords="1,-2,616,66" href="index.htm" alt="Perl Cookbook"><area shape="rect" coords="629,-11,726,25" href="jobjects/fsearch.htm" alt="Search this book" /></map><div class="navbar"><p><TABLEWIDTH="684"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="228"><ACLASS="preface"HREF="prf1_01.htm"TITLE="Foreword"><IMGSRC="../gifs/txtpreva.gif"ALT="Previous: Foreword"BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="228"></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="228"><ACLASS="sect1"HREF="prf2_02.htm"TITLE="Platform Notes"><IMGSRC="../gifs/txtnexta.gif"ALT="Next: Platform Notes"BORDER="0"></A></TD></TR></TABLE></DIV><DIVCLASS="preface"><H1CLASS="preface"><ACLASS="title"NAME="ch00-chap00_preface_0">Preface</A></H1><DIVCLASS="htmltoc"><P><B>Contents:</B><BR><ACLASS="sect1"HREF="#ch00-pgfId-1000002024"TITLE="What's in This Book">What's in This Book</A><BR><ACLASS="sect1"HREF="prf2_02.htm"TITLE="Platform Notes">Platform Notes</A><BR><ACLASS="sect1"HREF="prf2_03.htm"TITLE="Other Books">Other Books</A><BR><ACLASS="sect1"HREF="prf2_04.htm"TITLE="Conventions Used in This Book">Conventions Used in This Book</A><BR><ACLASS="sect1"HREF="prf2_05.htm"TITLE="We'd Like to Hear from You">We'd Like to Hear from You</A><BR><ACLASS="sect1"HREF="prf2_06.htm"TITLE="Acknowledgments">Acknowledgments</A></P><P></P></DIV><BLOCKQUOTECLASS="blockquote"><PCLASS="para">The investment group eyed the entrepreneur with caution, their expressions flickering from scepticism to intrigue and back again.</P><PCLASS="para">"Your bold plan holds promise," their spokesman conceded. "But it is very costly and entirely speculative. Our mathematicians mistrust your figures. Why should we entrust our money into your hands? What do you know that we do not?"</P><PCLASS="para">"For one thing," he replied, "I know how to balance an egg on its point without outside support. Do you?" And with that, the entrepreneur reached into his satchel and delicately withdrew a fresh hen's egg. He handed over the egg to the financial tycoons, who passed it amongst themselves trying to carry out the simple task. At last they gave up. In exasperation they declared, "What you ask is impossible! No man can balance an egg on its point."</P><PCLASS="para">So the entrepreneur took back the egg from the annoyed businessmen and placed it upon the fine oak table, holding it so that its point faced down. Lightly but firmly, he pushed down on the egg with just enough force to crush in its bottom about half an inch. When he took his hand away, the egg stood there on its own, somewhat messy, but definitely balanced. "Was that impossible?" he asked.</P><PCLASS="para">"It's just a trick," cried the businessmen. "Once you know how, anyone can do it."</P><PCLASS="para">"True enough," came the retort. "But the same can be said for anything. Before you know how, it seems an impossibility. Once the way is revealed, it's so simple that you wonder why you never thought of it that way before. Let me show you that easy way, so others may easily follow. Will you trust me?"</P><PCLASS="para">Eventually convinced that this entrepreneur might possibly have something to show them, the skeptical venture capitalists funded his project. From the tiny Andalusian port of Palos de Moguer set forth the <CITECLASS="citetitle">Ni馻</CITE>, the <CITECLASS="citetitle">Pinta</CITE>, and the <CITECLASS="citetitle">Santa Mar韆</CITE>, led by an entrepreneur with a slightly broken egg and his own ideas: Christopher Columbus.</P><PCLASS="para">Many have since followed.</P></BLOCKQUOTE><PCLASS="para">Approaching a programming problem can be like balancing Columbus's egg. If no one shows you how, you may sit forever perplexed, watching the egg&nbsp;- and your program&nbsp;- fall over again and again, no closer to the Indies than when you began. This is especially true in a language as idiomatic as Perl.</P><PCLASS="para">This book had its genesis in two chapters of the first edition of <ACLASS="citetitle"HREF="../prog/index.htm"TITLE="Programming Perl"><CITECLASS="citetitle">Programming Perl</CITE></A>. Chapters 5 and 6 covered "Common Tasks in Perl" and "Real Perl Programs." Those chapters were highly valued by readers because they showed real applications of the language&nbsp;- how to solve day-to-day tasks using Perl. While revising the Camel, we realized that there was no way to do proper justice to those chapters without publishing the new edition on onionskin paper or in multiple volumes. The book you hold in your hands, published two years after the revised Camel, tries to do proper justice to those chapters. We trust it has been worth the wait.</P><PCLASS="para">This book isn't meant to be a complete reference book for Perl, although we do describe some parts of Perl previously undocumented. Having a copy of <ACLASS="citetitle"HREF="../prog/index.htm"TITLE="Programming Perl"><CITECLASS="citetitle">Programming Perl</CITE></A> handy will allow you to look up the exact definition of an operator, keyword, or function. Alternatively, every Perl installation comes with over 1,000 pages of searchable, online reference materials. If those aren't where you can get at them, see your system administrator.</P><PCLASS="para">Neither is this book meant to be a bare-bones introduction for programmers who've never seen Perl before. That's what <ACLASS="citetitle"HREF="http://www.oreilly.com/catalog/lperl2/">TITLE="Learning Perl"><CITECLASS="citetitle">Learning Perl</CITE></A>, a kinder and gentler introduction to Perl, is designed for. (If you're on a Microsoft system, you'll probably prefer the <ACLASS="citetitle"HREF="http://www.oreilly.com/catalog/lperlwin/"TITLE="Learning Perl on Win32 Systems"><CITECLASS="citetitle">Learning Perl on Win32 Systems</CITE></A> version.)</P><PCLASS="para">Instead, this is a book for learning <EMCLASS="emphasis">more</EM> Perl. Neither a reference book nor a tutorial book, the <ACLASS="citetitle"HREF="index.htm"TITLE="Perl Cookbook"><CITECLASS="citetitle">Perl Cookbook</CITE></A> serves as a companion book to both. It's for people who already know the basics but are wondering how to mix all those ingredients together into a complete program. Spread across 20 chapters and more than 300 focused topic areas affectionately called recipes, this book contains thousands of solutions to everyday challenges encountered by novice and journeyman alike.</P><PCLASS="para">We tried hard to make this book useful for both random and sequential access. Each recipe is self-contained, but has a list of references at the end should you need further information on the topic. We've tried to put the simpler, more common recipes toward the front of each chapter and the simpler chapters toward the front of the book. Perl novices should find that these recipes about Perl's basic data types and operators are just what they're looking for. We gradually work our way through topic areas and solutions more geared toward the journeyman Perl programmer. Every now and then we include material that should inspire even the master Perl programmer.</P><PCLASS="para">Each chapter begins with an overview of that chapter's topic. This introduction is followed by the main body of each chapter, its recipes. In the spirit of the Perl slogan of TMTOWTDI, "There's more than one way to do it," most recipes show several different techniques for solving the same or closely related problems. These recipes range from short-but-sweet solutions to in-depth mini-tutorials. Where more than one technique is given, we often show costs and benefits of each approach.</P><PCLASS="para">As with a traditional cookbook, we expect you to access this book more or less at random. When you want to learn how to do something, you'll look up its recipe. Even if the exact solutions presented don't fit your problem exactly, they'll give you ideas about possible approaches.</P><PCLASS="para">Each chapter concludes with one or more complete programs. Although some recipes already include small programs, these longer applications highlight the chapter's principal focus and combine techniques from other chapters, just as any real-world program would. All are useful, and many are used on a daily basis. Some even helped us put this book together.</P><DIVCLASS="sect1"><H2CLASS="sect1"><ACLASS="title"NAME="ch00-pgfId-1000002024">What's in This Book</A></H2><PCLASS="para">The first quarter of the book addresses Perl's basic data types, spread over five chapters. <ACLASS="xref"HREF="ch01_01.htm"TITLE="Strings">Chapter 1, <CITECLASS="chapter">Strings</CITE></A>, covers matters like accessing substrings, expanding function calls in strings, and parsing comma-separated data. <ACLASS="xref"HREF="ch02_01.htm"TITLE="Numbers">Chapter 2, <CITECLASS="chapter">Numbers</CITE></A>, tackles oddities of floating point representation, placing commas in numbers, and pseudo-random numbers. <ACLASS="xref"HREF="ch03_01.htm"TITLE="Dates and Times"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -