📄 index.html
字号:
shmwrite (ID, BUFFER, POS, SIZE)</A><LI><A HREF="ch25.htm#shutdownSOCKETHOW">shutdown (SOCKET, HOW)</A><LI><A HREF="ch25.htm#sinEXPR">sin ([EXPR])</A><LI><A HREF="ch25.htm#sleepNUMSECONDSTOSLEEP">sleep ([NUM_SECONDS_TO_SLEEP])</A><LI><A HREF="ch25.htm#socketSOCKETDOMAINTYPEPROTOCOL">socket (SOCKET, DOMAIN, TYPE, PROTOCOL)</A><LI><A HREF="ch25.htm#socketpairSOCKETSOCKETDOMAINTYPEPROTOCOL">socketpair (SOCKET1, SOCKET2, DOMAIN, TYPE, PROTOCOL)</A><LI><A HREF="ch25.htm#sortSUBNAMEBLOCKLIST">sort ([SUBNAME | BLOCK], LIST)</A><LI><A HREF="ch25.htm#spliceARRAYOFFSETLENGTHLIST">splice (ARRAY, OFFSET, [LENGTH], [LIST])</A><LI><A HREF="ch25.htm#splitPATTERNEXPRLIMIT">split ([/PATTERN/], [EXPR], [LIMIT])</A><LI><A HREF="ch25.htm#sprintfFORMATLIST">sprintf (FORMAT, LIST)</A><LI><A HREF="ch25.htm#sqrtEXPR">sqrt ([EXPR])</A><LI><A HREF="ch25.htm#srandEXPR">srand ([EXPR])</A><LI><A HREF="ch25.htm#statFILEHANDLEEXPR">stat (FILEHANDLE | EXPR)</A><LI><A HREF="ch25.htm#studySCALAR">study ([SCALAR])</A><LI><A HREF="ch25.htm#substrEXPROFFSETLEN">substr (EXPR, OFFSET, [LEN])</A><LI><A HREF="ch25.htm#symlinkOLDFILENEWFILE">symlink (OLDFILE, NEWFILE)</A><LI><A HREF="ch25.htm#syscallLIST">syscall (LIST)</A><LI><A HREF="ch25.htm#sysopenFILEHANDLEFILENAMEMODEPERMISSIONS">sysopen (FILEHANDLE, FILENAME, MODE, [PERMISSIONS])</A><LI><A HREF="ch25.htm#sysreadFILEHANDLEBUFFERLENGTHOFFSET">sysread (FILEHANDLE, BUFFER, LENGTH, [OFFSET])</A><LI><A HREF="ch25.htm#systemLIST">system (LIST)</A><LI><A HREF="ch25.htm#syswriteFILEHANDLEBUFFERLENGTHOFFSET">syswrite (FILEHANDLE, BUFFER, LENGTH, [OFFSET])</A><LI><A HREF="ch25.htm#tellFILEHANDLE">tell ([FILEHANDLE])</A><LI><A HREF="ch25.htm#telldirDIRHANDLE">telldir (DIRHANDLE)</A><LI><A HREF="ch25.htm#tieVARIABLEPACKAGENAMELIST">tie (VARIABLE, PACKAGENAME, LIST)</A><LI><A HREF="ch25.htm#tiedVARIABLE">tied (VARIABLE)</A><LI><A HREF="ch25.htm#time">time ( )</A><LI><A HREF="ch25.htm#times">times ( )</A><LI><A HREF="ch25.htm#truNCateFILEHANDLEEXPRLENGTH">truNCate (FILEHANDLE | EXPR, LENGTH)</A><LI><A HREF="ch25.htm#ucEXPR">uc (EXPR)</A><LI><A HREF="ch25.htm#ucfirstEXPR">ucfirst (EXPR)</A><LI><A HREF="ch25.htm#umaskEXPR">umask ([EXPR])</A><LI><A HREF="ch25.htm#undefEXPR">undef ([EXPR])</A><LI><A HREF="ch25.htm#unlinkLIST">unlink (LIST)</A><LI><A HREF="ch25.htm#unpackTEMPLATEEXPR">unpack (TEMPLATE, EXPR)</A><LI><A HREF="ch25.htm#unshiftARRAYLIST">unshift (ARRAY, LIST)</A><LI><A HREF="ch25.htm#untieVARIABLE">untie (VARIABLE)</A><LI><A HREF="ch25.htm#utimeAccESSTIMEMODIFICATIONTIMELIST">utime (AccESS_TIME, MODIFICATION_TIME, LIST)</A><LI><A HREF="ch25.htm#valuesHASH">values (HASH)</A><LI><A HREF="ch25.htm#vecEXPROFFSETNUMBITS">vec (EXPR, OFFSET, NUM_BITS)</A><LI><A HREF="ch25.htm#wait">wait ( )</A><LI><A HREF="ch25.htm#waitpidPIDFLAGS">waitpid (PID, FLAGS)</A><LI><A HREF="ch25.htm#wantarray">wantarray ( )</A><LI><A HREF="ch25.htm#warnLIST">warn ([LIST])</A><LI><A HREF="ch25.htm#writeFILEHANDLEEXPR">write ([FILEHANDLE | EXPR])</A></UL></UL><H2><I><FONT SIZE=5 COLOR=#FF0000>Appendix </FONT></I><FONT SIZE=5 COLOR=#FF0000>D</FONT><FONT SIZE=5> Using the Registry</FONT></H2><UL><LI><A HREF="ch26.htm#RegistryFiles">Registry Files</A><UL><LI><A HREF="ch26.htm#HowtoBackUptheRegistry">How to Back Up the Registry</A><LI><A HREF="ch26.htm#HowtoRestoretheRegistry">How to Restore the Registry</A></UL><LI><A HREF="ch26.htm#UsingtheRegistry">Using the Registry</A><UL><LI><A HREF="ch26.htm#OpeninganExistingKey">Opening an Existing Key</A><LI><A HREF="ch26.htm#CreatingaNewKey">Creating a New Key</A><LI><A HREF="ch26.htm#FindingaKeysValue">Finding a Key's Value</A><LI><A HREF="ch26.htm#SettingaKeysNameValuePairs">Setting a Key's Name-Value Pairs</A><LI><A HREF="ch26.htm#GettingaListofSubkeys">Getting a List of Subkeys</A><LI><A HREF="ch26.htm#GettingaListofNameValuePairs">Getting a List of Name-Value Pairs</A></UL><LI><A HREF="ch26.htm#SomeCommonUsesfortheRegistry">Some Common Uses for the Registry</A><UL><LI><A HREF="ch26.htm#CreatingaFileAssociation">Creating a File Association</A><LI><A HREF="ch26.htm#SettingtheIconforaFileExtension">Setting the Icon for a File Extension</A><LI><A HREF="ch26.htm#EnablingthenewContextMenuOption">Enabling the 'new' Context Menu Option</A></UL><LI><A HREF="ch26.htm#Summary">Summary</A></UL><P><BR><H2><I><FONT COLOR="#FF0000"><A HREF="#CREDITS"><B>Credits</A></I></B></FONT></H2><HR WIDTH=100%><P><P>Copyright© 1996 by Que Corporation.<P>All rights reserved. Printed in the United States of America.No part of this book may be used or reproduced in any form orby any means, or stored in a database or retrieval system, withoutprior written permission of the publisher except in the case ofbrief quotations embodied in critical articles and reviews. Makingcopies of any part of this book for any purpose other than yourown personal use is a violation of United States copyright laws.For information, address Que Corporation, 201 W. 103rd Street,Indianapolis, IN 46290. You may reach Que's direct sales lineby calling 1-800-428-5331.<P><B>ISBN: 0-7897-0866-3</B><BR><A NAME="CREDITS"></A><B>HTML conversion by </B> : <BR> M/s. LeafWriters (India) Pvt. Ltd. <BR> <I>Website</I> : <A HREF=http://leaf.stpn.soft.net>http://leaf.stpn.soft.net</A> <BR> <I>e-mail</I> : <A HREF=mailto:leafwriters@leaf.stpn.soft.net>leafwriters@leaf.stpn.soft.net</A><P><HR><CENTER><TABLE WIDTH=40%><TR><TD WIDTH=145><B><FONT SIZE=2>President</FONT></B></TD><TD WIDTH=138><I><FONT SIZE=2>Roland Elgey</FONT></I></TD></TR><TR><TD WIDTH=145><B><FONT SIZE=2>Publisher</FONT></B></TD><TD WIDTH=138><I><FONT SIZE=2>Joseph B. Wikert</FONT></I></TD></TR><TR><TD WIDTH=145><B><FONT SIZE=2>Director of Marketing</FONT></B></TD><TD WIDTH=138><I><FONT SIZE=2>Lynn E. Zingraf</FONT></I></TD></TR></TABLE><P><TABLE><TR><TD WIDTH=148><B><FONT SIZE=2>Editorial Services Director</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Elizabeth Keaffaber</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Managing Editor</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Sandy Doell</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Title Manager</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Bryan Gambrel</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Project Director</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Al Valvano</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Production Editors</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Susan Ross Moore, Matthew B. Cox</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Editors</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Elizabeth Barrett, Anne Owen, Jeff Riley</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Product Marketing Manager</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Kim Margolius</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Assistant Product Marketing Manager</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Christy M. Miller</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Technical Editors</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Joe Milton, J. David Shinn, CNE, Synergetic Resource Corp.</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Technical Specialist</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Nadeem Muhammed</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Acquisitions Coordinator</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Carmen Krikorian</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Operations Coordinator</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Patricia J. Brooks</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Editorial Assistant</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Andrea Duvall</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Book Designer</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Barb Kordesh</FONT></I></TD></TR><TR><TD WIDTH=148><B><FONT SIZE=2>Cover Designer</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Ruth Harvey</FONT></I></TD><TD WIDTH=148><B><FONT SIZE=2>Production</FONT></B></TD><TD WIDTH=148><I><FONT SIZE=2>Bryan Flores</FONT></I></TD></TR></TABLE></CENTER><HR><P><H3>About the Author</H3><P><B>David Medinets</B> has been programming siNCe 1980, when hestarted with a TRS-80 Model 1. He still fondly remembers the dayswhen he could crosswire the keyboard to create funny-looking characterson the display. SiNCe those days, he has spent time debuggingEmacs on UNIX machines, working on VAXen, and messing around withDOS microcomputers. David is married to Kathryn and lives in northwestNew Jersey. He runs Eclectic Consulting and has coauthored<I>Special Edition Using Lotus Notes Release 4 (</I>Que<I>), SpecialEdition Using Turbo C++ 4.5 for Windows (</I>Que<I>), MicrosoftOffice 95 Unleashed (</I>Sams<I>), </I>and<I> Visual Basic Unleashed</I>(Sams), among others<I>. </I>David can be reached at <B>medined@planet.net</B>.<H3>Acknowledgments</H3><P>I'd like to thank all of the people at Que for making this bookpossible. You'll find their names listed on the Credits page, so I won't list them all here. Susan Ross Moore deserves specialthanks for figuratively watching over my shoulder as I worked.Her comments definitely made this a better book. Al Valvano wasinstrumental in making sure that everything came together at theproper time.<P>My wonderful wife deserves some thanks for letting me hang outon the Internet at all hours of the day and night while I didresearch for this book.<P>While writing this book, I have gleaned information from manybooks, articles, and Web resources. Where a particular item greatlyinflueNCed my thinking, I have given credit in the appropriatesection.<P>Dale Bewley helped to create Chapter 19, "What Is CGI?"-ThanksDale!<P>And of course, no Perl author should forget to thank: Larry Wallfor creating Perl in the first place; Tom Christiansen for hisremarkable contributions to the Perl community; and Randal Schwartzfor his Learning Perl book which every Perl programmer seems tohave read.<P>Thanks,<BR><I><B>David</B></I><H4>We'd Like to Hear from You!</H4><P>As part of our continuing effort to produce books of the highestpossible quality, Que would like to hear your comments. To staycompetitive, we <I>really</I> want you, as a computer book readerand user, to let us know what you like or dislike most about thisbook or other Que products.<P>You can mail comments, ideas, or suggestions for improving futureeditions to the address below, or send us a fax at (317) 581-4663.Our staff and authors are available for questions and commentsthrough our Internet site, at http://www.mcp.com/que, and<B> </B>MacmillanComputer Publishing also has a forum on CompuServe (type <B>GOQUEBOOKS</B> at any prompt).<P>In addition to exploring our forum, please feel free to contactme personally to discuss your opinions of this book: I'm<B> </B>avalvano@que.mcp.comon the Internet, and 74671,3710<B> </B>on CompuServe.<P>Thanks in advaNCe-your comments will help us to continue publishingthe best books available on new computer technologies in today'smarket.<P><DIV ALIGN=RIGHT><B>Al Valvano</B><br>Project Director<BR>Que Corporation<BR>201 W. 103rd Street<BR>Indianapolis, Indiana 46290<BR>USA</DIV><H3>Introduction</H3><P>This book is based on the learn-by-doing priNCiple because I believethat simply reading about a subject makes it harder to learn.After all, you don't read about putting together a jigsaw puzzle;you put the puzzle together yourself! Programming is the sameway. You must actually run some programs in order to really understandthe coNCepts.<P><I>Perl 5 By Example</I> will teach you how to use the Perl programminglanguage by showing examples that demonstrate the coNCepts beingdiscussed. The examples are designed to give you a chaNCe to experiment-whichin turn should clarify the material.<P>Additional information and errata pages can be found at <B>http://www.mtolive.com/pbe/index.html</B>.<P>The topics are covered in a straightforward, nontechnical manner,which allows you to quickly understand the fundamental priNCiples.After the main topic of each chapter is introduced, subtopicsare explored in their own sections. Each section has its own Perlexamples with explanations given in pseudocode.<P>Each chapter finishes with review questions of varying difficultybased on the material in that chapter. The answers usually comefrom the text or are deducible from the text, but occasionallyyou might need to experiment a little. Try to answer the questionsat all difficulty levels. If you get stuck turn to the answersprovided in Appendix A. Also, look at the summary sections afterreading each chapter and return to them frequently. After you'vegone through several chapters, you'll begin to understand moreoften the reason why a coNCept was illustrated or a question wasasked. Returning to questions that frustrated you earlier andrealizing that now you know the answers can be a big confideNCebuilder.<H3>Who Should Use This Book?</H3><P><I>Perl 5 By Example</I> should be read by anyone seeking to learnPerl. If you don't know any other programming languages, Chapters2 through 7 will give you a solid introduction to the basics.If you already know another language, then skip Chapters 2 through7 to see how Perl differs from other languages and start withChapter 8, "RefereNCes."<P>This book follows a simple format. Each chapter contains a singletopic-usually. First, you read about the topic and then you seeexamples that let you work directly with Perl to understand howthe coNCepts can be applied to a program. At the end of each chapteris a summary, followed by review questions and exercises.<P>This approach is designed to serve a broad range of readers fromnovice to advaNCed. If you've never programmed before, the learn-by-doingapproach will help you move quickly and easily though this book.If you have programming experieNCe, you'll find plenty of materialto refine and enhaNCe what you already know, and to give you asolid understanding of how Perl works.<H3>What Do I Need?</H3><P>In order to effectively use this book you need two things. Youneed a working copy of Perl 5. And you need a text editor. That'sit.<P>You can use the examples in this book with just about any hardwareand operating system. I'm not sure that they would work on anAmiga system but other than that you should be able to run everyexample.<H3>How to Use This Book</H3><P>There are several ways to use this book. One obvious method isto begin at the first page and proceed in order until the last.Most beginning programmers will use this method and the book isspecifically designed so that each chapter builds on the last.Alternatively, you can read up to Chapter 10, "Regular Expressions,"and then skip to Appendix C, "FuNCtion List." You canthen read specific chapters as needed when your projects demandthem. Either approach works.<P><CENTER><TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%><TR><TD WIDTH=576><B><FONT SIZE=2>Tip</FONT></B></TD></TR><TR><TD WIDTH=576><BLOCKQUOTE><FONT SIZE=2>It is critical to read through the FuNCtion List (Appendix C) at least oNCe before starting any major project. Otherwise, you might spend hours developing a fuNCtion that Perl already has predefined.</FONT></BLOCKQUOTE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -