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

📄 ch01_01.htm

📁 编程珍珠,里面很多好用的代码,大家可以参考学习呵呵,
💻 HTM
字号:
<html><head><title>An Overview of Perl (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 &amp; Associates, Inc."><meta name="DC.Source" content="" scheme="ISBN"><meta name="DC.Subject.Keyword" content=""><meta name="DC.Title" content="An Overview of Perl"><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="part1.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="part1.htm">Part 1: Overview</a></td><td align="right" valign="top" width="172"><a href="ch01_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 1.  An Overview of Perl</h1><div class="htmltoc"><h4 class="tochead">Contents:</h4><p><a href="ch01_01.htm">Getting Started</a><br><a href="ch01_02.htm">Natural and Artificial Languages</a><br><a href="ch01_03.htm">An Average Example</a><br><a href="ch01_04.htm">Filehandles</a><br><a href="ch01_05.htm">Operators</a><br><a href="ch01_06.htm">Control Structures</a><br><a href="ch01_07.htm">Regular Expressions</a><br><a href="ch01_08.htm">List Processing</a><br><a href="ch01_09.htm">What You Don't Know Won't Hurt You (Much)</a><br></p></div><h2 class="sect1">1.1. Getting Started</h2><p>We think that Perl is an easy language to learn and use, and we hope toconvince you that we're right.  One thing that's easy about Perl is thatyou don't have to say much before you say what you want to say.  In manyprogramming languages, you have to declare the types, variables, andsubroutines you are going to use before you can write the firststatement of executable code.  And for complex problems demandingcomplex data structures, declarations are a good idea.  But for many simple,everyday problems, you'd like a programming language in which youcan simply say:<blockquote><pre class="programlisting">print "Howdy, world!\n";</pre></blockquote>and expect the program to do just that.<a name="INDEX-17"></a></p><p>Perl is such a language.  In fact, this example is a completeprogram,<a href="#FOOTNOTE-1">[1]</a> and if you feed it to the Perlinterpreter, it will print "<tt class="literal">Howdy, world!</tt>" on your screen.(The <tt class="literal">\n</tt> in the example produces a newline at the end of the output.)<a name="INDEX-18"></a></p><blockquote class="footnote"><a name="FOOTNOTE-1"></a><p>[1] Or script, or application, or executable, ordoohickey.  Whatever.</p></blockquote><p>And that's that.  You don't have to say much <em class="emphasis">after</em> you say what youwant to say, either. Unlike many languages, Perl thinks that falling offthe end of your program is just a normal way to exit the program.  Youcertainly <em class="emphasis">may</em> call the <tt class="literal">exit</tt> function explicitly if you wish, justas you <em class="emphasis">may</em> declare some of your variables, or even<em class="emphasis">force</em> yourself to declare all your variables.  Butit's your choice.  With Perl you're free to do The Right Thing, howeveryou care to define it.<a name="INDEX-19"></a><a name="INDEX-20"></a></p><p>There are many other reasons why Perl is easy to use, but it would bepointless to list them all here, because that's what the rest of thebook is for.  The devil may be in the details, as they say, but Perltries to help you out down there in the hot place too.  At every level,Perl is about helping you get from here to there with minimum fuss andmaximum enjoyment.  That's why so many Perl programmers go around with asilly grin on their face.</p><p>This chapter is an overview of Perl, so we're not trying to presentPerl to the rational side of your brain.  Nor are we trying to becomplete, or logical.  That's what the following chapters arefor.  Vulcans, androids, and like-minded humans should skipthis overview and go straight to <a href="ch02_01.htm">Chapter 2, "Bits and Pieces"</a>, for maximuminformation density.  If, on the other hand, you're looking for acarefully paced tutorial, you should probably get Randal's nice book,<em class="citetitle">Learning Perl</em> (published by O'Reilly &amp; Associates).  But don't throw this book out just yet.</p><p>This chapter presents Perl to the <em class="emphasis">other</em> side of your brain, whetheryou prefer to call it associative, artistic, passionate, or merelyspongy.  To that end, we'll be presenting various views of Perl thatwill give you as clear a picture of Perl as the blind men had of theelephant.  Well, okay, maybe we can do better than that.  We're dealingwith a camel here (see the cover).  Hopefully, at least one of these viewsof Perl will help get you over the hump.</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="part1.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="ch01_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr><tr><td align="left" valign="top" width="172">Part 1. Overview</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">1.2. Natural and Artificial Languages</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 &copy; 2001</a> O'Reilly &amp; 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 + -