CGI and Perl

Other Supplementary Programs

Other programs included in the HyperCal distribution are cal_admin, which facilitates the creation of new users, and del_date, which allows the deletion of a datebook entry.


This chapter has introduced you to how Perl5 can be used to write CGIs that manipulate data. and a database module could be used to make this code even more modular and powerful. I encourage you to take principles in this chapter and play with them by enhancing them with currently available Perl5 modules. The ability to extend the features and create entirely new applications from simpler modules is what makes Perl5 the most efficient and powerful way to develop dynamic server-side Web applications.


  • Implementation Issues
  • GD: Dynamic Images
  • Hangman Using the GD Module
  • Server Push Animation Techniques
  • Other Techniques

Multimedia is an ambiguous term that is used to describe many different things. This chapter focuses on multimedia as that which goes beyond ordinary text and graphics, pushing the limits of HTML to bring Web pages to life. An immediate thought that may come to mind is that of adding audio and video. Small, animated graphics are a popular attraction for many Web site builders. Although many animation techniques might be best done using a client-side language such as Java, you can do several things from the server using Perl.

In this chapter, you explore the use of the GD Perl modules developed by Lincoln Stein. You also look into server push techniques and quickly review other ways you can embed multimedia into your Web pages.

Implementation Issues

One important consideration when discussing multimedia is performance. Bandwidth is once again the limiting factor when you're creating good animation representation on the Web. You should consider some of the ideas discussed previously in this tutorial to reduce the size of your images. Although your animated graphics may entice people to visit your Web site, the visitors can just as easily be driven away by those same graphics because of the time it may take to download them.

Another important consideration is color depth. Images are best represented using 24-bit color; however, using this color can be very expensive in terms of file size. You have to measure the trade-off between representation of true color and performance. One way to do so is to use a lower depth of color and create your own logical color space. You can create an image that uses only 256 colors but define your own custom colors to suit the image. Color depth becomes even more important as you start using multiple images to create the animation.