Home
Username:
Password:
Perl Fundamentals Tutorials

Making Choices / Now you try: Choices




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

Now that you've had a good look at using conditionals in Perl, I am going to set you a couple of exercises at the end of this chapter, so that you can try them yourself. First of all take this arbitrary condition on board, the fact that I only like two kinds of fruits, black grapes and red apples. Using this logic and the scalar variables, fruit and color, write the conditional statement that will output a result depending on whether or not I like certain piece of fruit using only those two scalar variables. The other exercise is to imagine that in some futuristic environment, you are telling your very literal minded robot butler how it should great your guests. What you've done is you've assigned a level of formality to each of the guests that are invited to dinner, and the levels of formality each carry with them a certain greeting. So the level of 0 will get this kind of greeting, level of 1 deserves this kind of greeting, level two and right up to level three. Variables you have to play with are the person's sex, their first name, their last name, and the level of formality that you assign to that guest. Now construct conditional statements that will get the robot butler to appropriately greet each guest. You will find some scripts that do exactly what these exercises are talking about, under the examples folder of the CD.

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