| Contents at a Glance | 4 |
---|
| Contents | 6 |
---|
| About the Author | 14 |
---|
| About the Technical Reviewer | 16 |
---|
| Acknowledgments | 18 |
---|
| Introduction | 20 |
---|
| PART 1 CGI Development with Perl | 22 |
---|
| CHAPTER 1 The CGI Module | 24 |
| An Overview of CGI | 24 |
| What You Need for This Chapter | 25 |
| Hello World, CGI Style | 26 |
| A Closer Look at the CGI.pm Functions | 32 |
| Environment Variables | 44 |
| Interaction with the System | 47 |
| Debugging and Troubleshooting | 48 |
| Security Considerations with CGI Programs | 52 |
| Summary | 55 |
| CHAPTER 2 Popular CGI Modules | 56 |
| Integration with Other Modules | 56 |
| Interaction Based on Environment Variables | 66 |
| Security Considerations with CGI Modules | 68 |
| Summary | 68 |
| CHAPTER 3 Databases and Perl | 70 |
| Interacting with a Database | 70 |
| Using SQL Databases with the DBI | 76 |
| Interacting with the Web | 86 |
| Troubleshooting Database Interaction | 91 |
| Security Considerations with Data Access | 91 |
| Summary | 92 |
| CHAPTER 4 System Interaction | 94 |
| Perl Scripts and the Operating System | 94 |
| Working with Filehandles | 94 |
| Uploading Files with CGI.pm | 98 |
| Working with System Processes | 104 |
| Security Considerations with System Interaction | 106 |
| Summary | 107 |
| PART 2 Internet Interaction with LWP and Net::Tools | 108 |
---|
| CHAPTER 5 LWP Modules | 110 |
| Getting Started with the LWP | 110 |
| HTTP from 29,999 Feet | 111 |
| Keeping It Simple with LWP::Simple | 113 |
| Getting More Functionality with LWP::UserAgent | 117 |
| Using the LWP | 118 |
| Removing HTML Tags from a Page | 124 |
| Security Considerations with the LWP | 125 |
| Summary | 126 |
| CHAPTER 6 Net:: Tools | 128 |
| Checking E-Mail with Net::POP3 | 128 |
| Checking E-Mail with Mail::Box | 138 |
| Sending E-Mail with SMTP | 139 |
| Checking DNS with Net::DNS | 146 |
| Sending a Ping with Net::Ping | 149 |
| Security Considerations with Net:: Modules | 154 |
| Summary | 154 |
| PART 3 XML and RSS | 156 |
---|
| CHAPTER 7 SOAP-Based Web Services | 158 |
| A Quick SOAP Primer | 158 |
| SOAP Meets Perl: SOAP::Lite | 160 |
| Creating a SOAP Listener | 167 |
| Consuming a SOAP Web Service | 169 |
| Security Considerations with SOAP Web Services | 173 |
| Summary | 173 |
| CHAPTER 8 Perl and RSS | 174 |
| RSS: Versioning Fun | 174 |
| Reading RSS with XML::RSS | 175 |
| Writing RSS with XML::RSS | 180 |
| Security Considerations with RSS | 183 |
| Summary | 184 |
| CHAPTER 9 XML Parsing with Perl | 186 |
| XML Parsing Methods | 186 |
| XML Parsing Considerations | 187 |
| Parsing XML with XML::Simple | 187 |
| Parsing XML with XML::SAX | 193 |
| Using Tree-Based Parsing | 200 |
| Security Considerations with XML Parsing | 201 |
| Summary | 201 |
| PART 4 Performance Enhancement with mod_perl | 202 |
---|
| CHAPTER 10 Apache and mod_perl | 204 |
| How Apache Handles Requests | 204 |
| mod_cgi vs. mod_perl | 208 |
| Apache::Registry vs. Apache::PerlRun | 210 |
| mod_perl Installation | 214 |
| From mod_cgi to mod_perl | 220 |
| Security Considerations with mod_perl | 221 |
| Summary | 221 |
| CHAPTER 11 Development with mod_perl | 222 |
| Thinking in mod_perl | 222 |
| Preloading Perl Modules | 228 |
| Working with the Apache Request Object | 230 |
| Working with the Apache Server | 247 |
| Security Considerations with mod_perl, Revisited | 250 |
| Summary | 251 |
| PART 5 Creating Web Templates | 252 |
---|
| CHAPTER 12 The Template Toolkit | 254 |
| Perl and Templates | 254 |
| Template Toolkit Introduction | 255 |
| Template Toolkit Syntax | 261 |
| Building a Web Site with Template::Toolkit | 278 |
| Security Considerations | 283 |
| Summary | 283 |
| CHAPTER 13 Perl Web Sites with Mason | 284 |
| Introducing Mason | 284 |
| Installing Mason | 286 |
| Mason Syntax | 290 |
| Building a Web Site with Mason | 299 |
| Security Considerations with Mason | 302 |
| Summary | 302 |
| APPENDIX Perl Basics | 304 |
---|
| Our First Perl Program | 304 |
| Types of Data | 306 |
| Operators | 314 |
| Variables | 327 |
| Variable Interpolation | 334 |
| The if Statement | 336 |
| Looping Constructs | 347 |
| The while Loop | 347 |
| Loop Control Constructs | 354 |
| Summary | 359 |
| Index | 360 |