Survey Says?

Everybody wants to be somebody. Everybody wants to know that his or her opinions count—and almost as important—everyone wants to know how his opinions stack up against others. That's what surveys are all about.

In the next exercise, you'll look at a small program to create a survey form and then a program to print the survey results. The survey is a text file consisting of a question, followed by choices, put into a directory on the Web server and named with a .txt extension. The text file should look something like the following, with no other punctuation or blank lines:

My favorite kind of pet is:
Dog
Cat
Fish
Peeve

The first program looks in that directory for a file with a .txt extension—taking the last one if multiple files ...

Get Sams Teach Yourself Perl in 24 Hours 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.