Beginning Web Development with Perl nabohome

Beginning Web Development With Perl Nabohome-Free PDF

  • Date:15 May 2020
  • Views:48
  • Downloads:0
  • Pages:361
  • Size:2.23 MB

Share Pdf : Beginning Web Development With Perl Nabohome

Download and Preview : Beginning Web Development With Perl Nabohome

Report CopyRight/DMCA Form For : Beginning Web Development With Perl Nabohome


Beginning Web,Development with Perl,From Novice to Professional. Steve Suehring, Beginning Web Development with Perl From Novice to Professional. Copyright 2006 by Steve Suehring, All rights reserved No part of this work may be reproduced or transmitted in any form or by any means. electronic or mechanical including photocopying recording or by any information storage or retrieval. system without the prior written permission of the copyright owner and the publisher. ISBN pbk 1 59059 531 9, Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1. Trademarked names may appear in this book Rather than use a trademark symbol with every occurrence. of a trademarked name we use the names only in an editorial fashion and to the benefit of the trademark. owner with no intention of infringement of the trademark. Lead Editor Ewan Buckingham,Technical Reviewer James Lee.
Editorial Board Steve Anglin Dan Appleman Ewan Buckingham Gary Cornell Tony Davis Jason Gilmore. Jonathan Hassell Chris Mills Dominic Shakeshaft Jim Sumser. Project Managers Laura Cheu Richard Dal Porto,Copy Editors Marilyn Smith Nicole LeClerc. Assistant Production Director Kari Brooks Copony,Production Editor Ellie Fountain. Compositor Kinetic Publishing Services LLC,Proofreader Lori Bring. Indexer Rebecca Plunkett,Cover Designer Kurt Krames. Manufacturing Director Tom Debolski, Distributed to the book trade worldwide by Springer Verlag New York Inc 233 Spring Street 6th Floor.
New York NY 10013 Phone 1 800 SPRINGER fax 201 348 4505 e mail orders ny springer sbm com or. visit http www springeronline com, For information on translations please contact Apress directly at 2560 Ninth Street Suite 219 Berkeley. CA 94710 Phone 510 549 5930 fax 510 549 5939 e mail info apress com or visit http www apress com. The information in this book is distributed on an as is basis without warranty Although every precau. tion has been taken in the preparation of this work neither the author s nor Apress shall have any. liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly. or indirectly by the information contained in this work. The source code for this book is available to readers at http www apress com in the Source Code section. Contents at a Glance,About the Author xiii,About the Technical Reviewer xv. Acknowledgments xvii,Introduction xix,PART 1 CGI Development with Perl. CHAPTER 1 The CGI Module 3,CHAPTER 2 Popular CGI Modules 35. CHAPTER 3 Databases and Perl 49,CHAPTER 4 System Interaction 73.
PART 2 Internet Interaction with LWP and,CHAPTER 5 LWP Modules 89. CHAPTER 6 Net Tools 107,PART 3 XML and RSS,CHAPTER 7 SOAP Based Web Services 137. CHAPTER 8 Perl and RSS 153,CHAPTER 9 XML Parsing with Perl 165. PART 4 Performance Enhancement with,CHAPTER 10 Apache and mod perl 183. CHAPTER 11 Development with mod perl 201,PART 5 Creating Web Templates.
CHAPTER 12 The Template Toolkit 233,CHAPTER 13 Perl Web Sites with Mason 263. APPENDIX Perl Basics 283,About the Author xiii,About the Technical Reviewer xv. Acknowledgments xvii,Introduction xix,PART 1 CGI Development with Perl. CHAPTER 1 The CGI Module 3,An Overview of CGI 3,What You Need for This Chapter 4. Hello World CGI Style 5,Function Oriented Hello World 5.
Object Oriented Hello World 9,A Closer Look at the CGI pm Functions 11. HTML Shortcuts 11,Dynamic Pages and Forms 12,Cookies 15. Environment Variables 23,Viewing Environment Variables 23. Carrying Values Between Forms 24,Interaction with the System 26. Debugging and Troubleshooting 27,Verbose Output 28.
Syntax Check 28,The Carp Module 29,Other Troubleshooting Tips 31. Security Considerations with CGI Programs 31,File Permissions 32. Taint Mode 32,Strictness 33,Untrusted Data from Forms 33. Untrusted Data from Cookies 34,Summary 34,vi CONTENTS. CHAPTER 2 Popular CGI Modules 35,Integration with Other Modules 35.
CGI Carp 35,URI Escape 39,Net SMTP 43,Mod perl and HTML Mason 44. Interaction Based on Environment Variables 45,Security Considerations with CGI Modules 47. Summary 47,CHAPTER 3 Databases and Perl 49,Interacting with a Database 49. The DBI 49,Database Drivers 50,Data Source Names Credentials and Attributes 51. Database Handles 52,Statement Handles 53,Error Handling 54.
Using SQL Databases with the DBI 55,Connecting to the Database 56. Disconnecting from the Database 57,Executing a Query 57. Retrieving the Results 58,Using the Quote Method for Dynamic Statements 61. Executing Other SQL Statements 62,Binding Parameters 62. Inserting Data into a Database 63,Interacting with the Web 65.
Outputting to HTML 65,Building HTML Tables 67,Troubleshooting Database Interaction 70. Security Considerations with Data Access 70,Stored Credentials 70. Unnecessary Privileges 71,Unsanitized Statements and Input 71. Summary 71,CONTENTS vii,CHAPTER 4 System Interaction 73. Perl Scripts and the Operating System 73,Working with Filehandles 73.
Opening Filehandles 74,Using die to Trap Errors 75. Reading from Filehandles 75,Writing to Filehandles 76. Closing Filehandles 76,Using File Tests 76,A Slight Aside Directory Listings 77. Uploading Files with CGI pm 77,Creating a File Upload Field 78. Accessing Uploading File Header Information 80,Protecting Temporary Files 83.
Working with System Processes 83,Executing System Processes from a Perl Program 84. Using System Processes Within a CGI Program 85, Security Considerations with System Interaction 85. Summary 86,PART 2 Internet Interaction with LWP,and Net Tools. CHAPTER 5 LWP Modules 89,Getting Started with the LWP 89. HTTP from 29 999 Feet 90,HTTP Requests 91,HTTP Responses 91.
Keeping It Simple with LWP Simple 92,Get Functions 93. The Head Function 94,The Mirror Function 95,Getting More Functionality with LWP UserAgent 96. Using the LWP 97,Retrieving a Web Page 97,Submitting a Web Form 100. Handling Cookies 101,Handling Password Protected Sites 101. viii CONTENTS,Mirroring a Web Site 102,Handling Proxies 102.
Removing HTML Tags from a Page 103,Security Considerations with the LWP 104. Summary 105,CHAPTER 6 Net Tools 107,Checking E Mail with Net POP3 107. Creating a POP3 Object 108, Setting and Getting Other POP3 Connection Parameters 108. Checking E Mail 110,Deleting E Mail and Quitting 116. Checking E Mail with Mail Box 117,Sending E Mail with SMTP 118.
Creating an SMTP Object 119,Setting Other SMTP Connection Parameters 120. Sending a Message 122,Checking DNS with Net DNS 125. Performing a Simple DNS Lookup 125,Searching for MX Records 127. Looking for the Authoritative DNS Servers 127,Sending a Ping with Net Ping 128. Creating a Ping Object 129,Sending an ICMP Echo Request 130.
Getting More Accurate Times 131,Sending a TCP Check 132. Security Considerations with Net Modules 133,Summary 133. PART 3 XML and RSS,CHAPTER 7 SOAP Based Web Services 137. A Quick SOAP Primer 137,SOAP Meets Perl SOAP Lite 139. Importing and Debugging SOAP Lite 139,Setting Up the SOAP Object 140.
Calling SOAP Methods 142,Handling SOAP Errors 144,Setting Types and Names 145. CONTENTS ix,Creating a SOAP Listener 146,Consuming a SOAP Web Service 148. Calling Your SOAP Server 148, Calling the National Weather Service SOAP Service 149. Security Considerations with SOAP Web Services 152. Summary 152,CHAPTER 8 Perl and RSS 153,RSS Versioning Fun 153. Reading RSS with XML RSS 154,Parsing RSS Feeds 155.
Debugging RSS Scripts 158,Writing RSS with XML RSS 159. Security Considerations with RSS 162,Summary 163,CHAPTER 9 XML Parsing with Perl 165. XML Parsing Methods 165,XML Parsing Considerations 166. Parsing XML with XML Simple 166,Data Dumper 168,XML Simple Options 170. Parsing XML with XML SAX 172,XML SAX Parser Methods 173.
SAX2 Handler Interfaces 173,A Basic Parser and Handler 175. Using Tree Based Parsing 179,Security Considerations with XML Parsing 180. Summary 180,PART 4 Performance Enhancement,with mod perl. CHAPTER 10 Apache and mod perl 183,How Apache Handles Requests 183. Apache s Child Processes 184,Forking 186,x CONTENTS.
mod cgi vs mod perl 187,Benefits of mod perl 188,Drawbacks of mod perl 188. Beyond CGI Programming with mod perl 188,Apache Registry vs Apache PerlRun 189. mod perl Installation 193,Getting the Code 193,Unpacking the Code 194. Looking for Prerequisites 194,Building and Installing mod perl 194. Choosing Compile Options 198,Configuring for mod perl 198.
From mod cgi to mod perl 199,Security Considerations with mod perl 200. Summary 200,CHAPTER 11 Development with mod perl 201. Thinking in mod perl 201,Initial Considerations 201. Apache Registry vs Apache PerlRun Revisited 202,Preloading Perl Modules 207. Preloading Apache DBI 207,Preloading Other Modules and Methods 209.
Working with the Apache Request Object 209,Accessing the Request 210. Accessing the Response 220,Working with Cookies 222. Uploading Files 225,Working with the Apache Server 226. Getting Information About the Server 226,Controlling Logging 227. Security Considerations with mod perl Revisited 229. Summary 230,PART 5 Creating Web Templates,CHAPTER 12 The Template Toolkit 233.
Perl and Templates 233,Template Toolkit Introduction 234. Template Toolkit Example 234,Using the Template Toolkit 235. CONTENTS xi,Template Toolkit Syntax 240,Chomping 241. Interpolation 242,Comments 242,Tag Styles 243,Variables 244. Virtual Methods 246,Directives 246,Plug ins 255,Building a Web Site with Template Toolkit 257.
Creating a Site Configuration File 257,Building the Site 259. Security Considerations 262,Summary 262,CHAPTER 13 Perl Web Sites with Mason 263. Introducing Mason 263,Installing Mason 265,Compiling Mason 265. Configuring Apache and Mason 267,Mason Syntax 269,Components 270. Request Objects 276,Handlers 276,Subrequests and More 278.
Building a Web Site with Mason 278,Building a Page 278. Creating Headers and Footers 279,Using Return Values 280. Security Considerations with Mason 281,Summary 281. APPENDIX Perl Basics 283,Our First Perl Program 283. Keywords 284,Statements and Statement Blocks 284,Escape Sequences 284.
White Space 285,xii CONTENTS,Types of Data 285,Numbers 285. Strings 288,Here Documents 291,Converting Between Numbers and Strings 292. Operators 293,Numeric Operators 293,String Operators 302. Variables 306,Modifying a Variable 306,Operating and Assigning at Once 308. Autoincrement and Autodecrement 308,Multiple Assignments 310.
Scoping 310,Variable Names 313,Variable Interpolation 313. The if Statement 315,Operators Revisited 316,Multiple Choice if else 321. The unless Statement 324,Expression Modifiers 324,Using Short Circuited Evaluation 325. Looping Constructs 326,The while Loop 326,while STDIN 327. Infinite Loops 329,Looping Until 329,The for Loop 330.
The foreach Loop 330,do while and do until 331,Loop Control Constructs 333. Breaking Out 333,Going On to the Next 334,Reexecuting the Loop 335. Loop Labels 336,Summary 338,About the Author, STEVE SUEHRING is a technology architect with a diverse set of skills Steve works with a wide. array of technologies from mainframe OS 390 to Microsoft Windows to several distributions. of Linux Steve has written a book on MySQL a book on Linux firewalls and numerous maga. zine articles During his tenure as an editor for LinuxWorld Magazine Steve focused on advocacy. of Linux and open source software as well as computer security Among the articles Steve wrote. for LinuxWorld Magazine is a cover story featuring the WilliamsF1 team s use of Linux to design. their Formula 1 car Steve is also a Cisco Certified Network Professional CCNP. About the Technical Reviewer, JAMES LEE is a hacker and open source advocate based in Illinois He. has a master s degree from Northwestern University where he can often. be seen rooting for the Wildcats during football season The founder of. Onsight http www onsight com he has worked as a programmer. trainer manager writer and open source advocate He is the coauthor of. the recently released Hacking Linux Exposed Second Edition Osbourne. McGraw Hill 2002 He has also written a number of articles on Perl for. Linux Journal Lee enjoys hacking Perl developing software for the Web. reading traveling and most of all playing with his kids who are too. young to know why Dad s favorite animals are penguins and camels. Steve Suehring Beginning Web Development with Perl From Novice to Professional

Related Books