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

📄 ch01.htm

📁 Web_Programming_with_Perl5,一个不错的Perl语言教程。
💻 HTM
📖 第 1 页 / 共 3 页
字号:
	<LI><FONT COLOR="#0000AA">Chapter 5:</FONT> &quot;Putting It All Together&quot;:



	How a typical HTTP transaction works, and how to use Perl modules to easily perform



	this task within a script for testing, debugging, or other purposes.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 6:</FONT> &quot;MIME Documents&quot;: MIME review



	and using the MIME module to dynamically encode/decode messages.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 7:</FONT> &quot;Simple Pleasures--Examples&quot;:



	Simple examples that have been implemented many times before, re-implemented using



	the libwww modules to demonstrate their ease of use, and utility.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 8:</FONT> &quot;Database Access&quot;: Accessing



	databases using the DBI modules, from within CGI and in general.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 9:</FONT> &quot;Agents--Web Scanning, Mirroring,



	and Background Tasks&quot;: Mirroring Web sites; generating Web indexes.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 10:</FONT> &quot;Search Engines&quot;: Other well-developed



	search algorithms to provide a searchable site. Some using Perl; some not.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 11:</FONT> &quot;Datebooks, Calendars, and Scheduling



	on the Web&quot;: Using the Perl as CGI to access, update, and confirm schedules,



	task lists, and general datebooks. Various algorithms, implementations.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 12:</FONT> &quot;Multimedia&quot;: GD, the dynamic



	graphics module is discussed, along with animation techniques.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 13: </FONT>&quot;Shopping Cart Applications&quot;:



	How to set up and maintain the MiniVend module.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 14:</FONT> &quot;Archive and Document Management&quot;:



	Document maintenance, updates, creation of new hierarchy within the archive. Document



	conversion from one format to another. Parsing HTTP logfiles to glean statistics.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 15:</FONT> &quot;Client-Side Perl&quot;: Netscape



	Perl plugins, using Perl as a helper application, the Perl Compiler (bytecode, C),



	and the new Penguin module.



	<P>



	<LI><FONT COLOR="#0000AA">Chapter 16:</FONT> &quot;Advanced CGI/HTML&quot;: Sessions,



	cookies, hidden fields to maintain state. The proposed &lt;OBJECT&gt; tag.



	<P>



	<LI><FONT COLOR="#0000AA">Appendix A:</FONT> &quot;Perl4 to Perl5 Traps.&quot;



</UL>







<H3 ALIGN="CENTER"><A NAME="Heading6"></A><FONT COLOR="#000077">A CPAN Overview</FONT></H3>



<P>You'll see the CPAN (Comprehensive Perl Archive Network) referred to many times



in this text, and after some consideration, we've decided that the overview of what



it is, its history, how it works, and why it's so important belongs here, in the



first chapter, rather than in the appendix. The CPAN, with its vast resources and



tools, is the foundation of this book. We'll do very little without the help of a



module, extension or other tool, including the source code for Perl itself, from



the CPAN.



<H4 ALIGN="CENTER"><A NAME="Heading7"></A><FONT COLOR="#000077">CPAN History</FONT></H4>



<P>When this author first discovered Perl in 1990, there was little or no means to



bootstrap oneself into the learning phase of programming Perl. The version that was



available to me at that time was 3.10, and it wasn't very easy to learn, unless one



was already familiar with the sed, grep, awk, and other languages, including C, along



with those dreaded UNIXisms, Regular Expressions. The UNIX manpage for Perl was long



and tedious to read, and made many assumptions about the level of the reader, in



terms of UNIX knowledge. At that time, I resolved that if I ever had a chance, I'd



try to do something about that.</P>



<P>When the <TT>comp.lang.perl</TT> newsgroup came along, the common folk suddenly



had access to the few true Perl wizards which existed at the time, including Larry



himself, along with Randal and Tom, Mark Biggar, and a few others who either worked



with Larry, were related to him, or had jumped onto the Perl bandwagon very early



on. This made things a little easier when one had a problem, but the Usenet protocol,



at that time, was quite a bit more respected, and thus I was a bit shy about posting



arbitrary bonehead questions.</P>



<P>Then, in 1991, the first version of the Camel was printed, by the O'Reilly company.



O'Reilly was kind enough to make available, along with UUNET, the examples which



were given in the text, as a single compressed tar file. Suddenly, everything got



a little easier. One could purchase the Camel, and then follow along directly with



the examples. This still wasn't enough to become an expert, or even accomplish any



given task, but it was a starting point.</P>



<P>Finally, in late 1991, I co-founded one of the first Mom 'n Pop ISPs in the country,



Texas Metronet. Almost as soon as I had the root password, I took the collection



of scripts which I'd gathered on the newsgroup, along with some of the other things



I'd seen around here and there, and created a little ftp area, with some general



hierarchy, including admin stuff, networking stuff, UI stuff, and assorted stuff;



and the first &quot;organized&quot; Perl archive available on the Net was born. Now



anyone could connect to this archive, and hopefully find a little ditty which would



help them accomplish the task they had at hand, or at least get them started.</P>



<P>Since then, there's been a mailing list formed for discussion of matters relevant



to archiving Perl, and, more importantly, the efforts of many separate Perl archivists



all over the Net has been unified and integrated into a single, comprehensive effort



known as the CPAN.



<H4 ALIGN="CENTER"><A NAME="Heading8"></A><FONT COLOR="#000077">CPAN Motivation</FONT></H4>



<P>As you might guess, the rate of new Perl archives, and separate, distinct locations



(we didn't have URLs back then) for a given work, grew rapidly. It became difficult



to keep track of where this or that tool or script was located, and whether it was



of any use. The most important tools which made it to the comp.sources newsgroups



were generally well maintained, and available at multiple locations, but other things



were quite unique. Some archives specialized in database access tools, others in



documentation, and others in source code for Perl and the various ports. A unification



was necessary, in order to make it simpler and more intuitive for the average newbie



Perl user to get what he/she needed to implement his/her task, without reinventing



the wheel.</P>



<P>So, due primarily to the efforts of a few tireless &quot;Perl Packrats,&quot;



including Jarkko Hietaniemi of Finland, the process of mirroring all of the existing



hierarchies into a single hierarchy was set into place.</P>



<P>Nowadays, the CPAN is much more than simply a collection of scripts, documents,



source, and miscellaneous tools and packages. It's become the de facto location for



all Perl modules, and extensions, ports, patches, source code, and every other thing.



There is also a dynamic, ongoing process attempting to make it easy to navigate,



and relatively easy to contribute to, if you ever wish to make something you've written



available on the Net.</P>



<P>The most important thing that the CPAN gives us is the ability to re-use code,



and save effort. This lends to one of the true and fine qualities of any good Perl



programmer: laziness. :-) We encourage you to explore the CPAN, and make use of it



often.



<H4 ALIGN="CENTER"><A NAME="Heading9"></A><FONT COLOR="#000077">CPAN Layout</FONT></H4>



<P>Once you've connected to a CPAN archive, there's quite a bit of hierarchy to navigate,



and it can be a bit intimidating at first to find your way around in there. The hierarchy



is relatively well thought out, believe it or not. Let's take a look at its hierarchy,



and try to give a formal description of how to get around. When you first connect



to any given CPAN site, you'll have to get to the top-level CPAN directory, to start.



Of course, if you're using a Web browser, you can just feed it a URL to get there.



Just connect to the one closest to you, and get to the top-level CPAN directory,



then follow along here.</P>



<P>At the top level, you'll find the following directories: 



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">authors</TD>



		<TD ALIGN="LEFT">Directory for all individually written submissions of modules, scripts, etc.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">doc</TD>



		<TD ALIGN="LEFT">Documentation and other informative bits</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">indices</TD>



		<TD ALIGN="LEFT">Indexes, in ls -lR format</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">misc</TD>



		<TD ALIGN="LEFT">Miscellaneous stuff, emacs libraries</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">modules</TD>



		<TD ALIGN="LEFT">specific modules by name, by category, and by author</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">ports</TD>



		<TD ALIGN="LEFT">ports of Perl to various architectures</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">scripts</TD>



		<TD ALIGN="LEFT">original scripts area, specific tools/toys</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><FONT COLOR="#000000">src</FONT></TD>



		<TD ALIGN="LEFT"><FONT COLOR="#000000">Perl sources, Versions 4 and 5</FONT></TD>



	</TR>



</TABLE>



Along with the above directories, you'll find the following files in the top level,



by default: 



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">CPAN</TD>



		<TD ALIGN="LEFT">Textual description of the archive, its sites, contributions, and maintenance.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">CPAN.html</TD>



		<TD ALIGN="LEFT">HTML form of CPAN</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">ENDINGS</TD>



		<TD ALIGN="LEFT">Filename extensions in use within the CPAN, and what they imply, in terms of MIME



			and specific applications.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">MIRRORED.BY</TD>



		<TD ALIGN="LEFT">Sites which mirror the CPAN, and are part of the Comprehensive Perl Archive Network,



			which are publicly accessible.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">MIRRORING.FROM</TD>



		<TD ALIGN="LEFT">Sites from which the master CPAN site, at FUNET in Finland, mirrors to create the



			master CPAN hierarchy.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">README</TD>



		<TD ALIGN="LEFT">Notes on the intent and principle of the CPAN from Jarkko Hietaniemi, the &quot;Self-Appointed



			Master Librarian (OOK!) of the CPAN&quot;</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">README.html</TD>



		<TD ALIGN="LEFT">HTML version of the README</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">RECENT</TD>



		<TD ALIGN="LEFT">A listing of the most recent submissions and uploads to the CPAN.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">RECENT.html</TD>



		<TD ALIGN="LEFT">HTML version of the RECENT text file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT">ROADMAP</TD>



		<TD ALIGN="LEFT">Simple overview of the CPAN hierarchy.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><FONT COLOR="#000000">ROADMAP.html</FONT></TD>



		<TD ALIGN="LEFT"><FONT COLOR="#000000">HTML version of the ROADMAP. Useful to navigate through the



			archive, if you don't mind waiting for repeated FTP connections through the Web browser.</FONT></TD>



	</TR>



</TABLE>



</P>



<P>As you can see, each of the files has a specific intent, and some of them provide



a view into the archive.</P>



<P>For the sake of brevity, however, let's take a closer look at the intent of each



of the top-level directories. 



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP">authors</TD>



		<TD ALIGN="LEFT" COLSPAN="2">This directory is really the foundation of the newer CPAN hierarchy. It has come



			into being during the last couple of years, specifically for the archival of works,



			in any form, by specific people. All of the numerous modules and extensions which



			can be used with Perl5 are to be found under here. There are numerous symlinks which



			correspond to the full name of the authors, along with the id directory.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"></TD>



		<TD WIDTH="68" ALIGN="LEFT" VALIGN="TOP">authors/id</TD>



		<TD ALIGN="LEFT">The layout of the authors directory is such that there exists a symlink with the



			name the same as the full name of the author which, in turn, points at the specific



			CPAN userid directory allotted to this author. The id directory, within the authors



			directory, contains the specific author directories. These authors/id/authorid directories



			are the most important in the CPAN, and form the foundation of all of the other views



			of the hierarchy. Thus, if you wish to obtain a module, and you know it was written



			by Dean Roehrich, for instance, you'd change the directory to the authors/Dean_Roehrich



			directory, which in turn points to authors/id/DMR dir-ectory. Dean himself controls



			what lives in the DMR dir-ectory through the automated features of the CPAN master



			site, and can automatically update the items, as he makes new releases, and delete



			older releases of his works.</TD>



⌨️ 快捷键说明

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