Chapter 15

The Interwebs

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Understanding the basics of the HTTP, including web servers, web forms, cookies and security issues
  • Understanding a web client’s role

WROX.COM CODE DOWNLOAD FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at http://www.wrox.com/remtitle.cgi?isbn=1118013847 on the Download Code tab. The code for this chapter is divided into the following major examples:

  • app.psgi and anne_frank_stamp.jpg
  • character.psgi
  • example_15_1_google_directions.pl
  • listing_15_1_get_links.pl
  • listing_15_2_get_comments.pl
  • listing_15_3_post_character.pl
  • params.psgi
  • templates/character.tt
  • templates/character_display.tt

Ah, Perl, the duct tape of the Internet. Duct tape has a reputation for being an amazing, ad hoc supertool for fixing things in a hurry, even as a combat dressing. Perl is the same way. Need something done on the web quickly? Reach for Perl!

This chapter pays particular attention to the HyperText Transfer Protocol (HTTP). When you view a web page in your browser, it was probably sent to you via HTTP (or HTTPS, the encrypted version of HTTP). HTTP is nothing more than text, and Perl excels at text manipulation. Your author believes you need a foundation of how HTTP flows between systems to effectively program at a higher level.

The first part of this chapter is about responding as a server. It will not be “Here’s how to write a web application”; though you create some simple ones, but rather, “Here are some concepts ...

Get Beginning Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.