Home
Username:
Password:
Perl Fundamentals Tutorials

Intermediate Coding Techniques / Modules and Packages (2)




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

We haven't done anything really special with the CGI module yet. All we've done is create a header for our HTML document that our Perl script is producing. That's not so terribly special when we are able to do that with one line of Perl in the first place. So what's so great about the CGI module? If we look right down the bottom of one of our scripts, and have a look at the rather convoluted code that we are having to use in order to process the data from the form, we can do all of this a lot more simply by using the CGI object that we've instantiated from CGI module. We can simply setup the chooser variable by calling one of the CGI objects methods, called param. And this is very concise indeed: all we need to do is to call the param method using this operator here from our CGI object, that we have instantiated at the top of this script with a certain parameter. In this case, chooser. And we can do the same for the data variable as well. In these 2 lines of code, act instead of all of this, all of those regular expressions, the whole loop reading in from standard input, splitting of the ampersand, break down at into key value pairs and so on. All of this is handled by those 2 simple lines there.

Tutorial Information

Course: Perl Fundamentals
Author: Joshua Mostafa
SKU: 33403
ISBN: 1-9320-7215-2
Release Date: 2002-12-19
Duration: 7.5 hrs / 113 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available