ebook img

Introduction to Cgi/Perl: Getting Started With Web Scripts PDF

180 Pages·1995·16.164 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Introduction to Cgi/Perl: Getting Started With Web Scripts

Steven E. i^renner win Aoki on o ntr I dixjLCti M&J 2-0 Introduction to CGI/Perl Introduction to CGI/Perl Steven E. Brenner Edwin Aol<i M&ra New York M&TBooks M(Ser A Di%ision ofMIS:Press, Inc. It A Subsidiary ofHenry Holt and Company, Inc. 115 West 18th Street New York, New York 10011 Copyright © 1996byStevenE. BrennerandEdwinAoki Printed in the United States ofAmerica All rights reserved. No part ofthis book may be reproduced or transmitted in any form or by any means, electronicormechanical, including photocopying, recording, orby any infor- mation storage and retrieval system, without prior written permission from the Publisher Contact the Publisher for information on foreign rights. LimitsofLiabilityandDisclaimerofWarranty The Author and Publisher ofthis book have used their best efforts in preparing the book and the programs contained in it. These efforts include thedevelopment, research, andtest- ing ofthe theories and programs to determine their effectiveness. TheAuthorand Publisher make nowarrantyofany kind, expressed or implied, with regard to these programs or the documentation contained in this book. The Author and Publisher shall not be liable in any event for incidental orconsequential damages in connectionwith, or arising out of, the furnishing, performance, or use ofthese programs. All products, names and services are trademarks or registered trademarks oftheirrespective companies. LibraryofCongressCataloging-in-PublicationData Brenner, Steven. Introduction to CGI/Perl : getting started with web scripts / by Steven Brenner and Edwin Aoki. p. cm. ISBN 1-55851-478-3 1. World Wide Web servers--Computer programs. 2. Perl (Computer pro- gram language) 3. CGI (Computer network protocol) I. Aoki, Edwin II. Title. TK5105.888.B75 1996 005.7'2--dc20 95-50755 CIP 99 98 97 96 4 3 Associate Publisher: Paul Farrell Managing Editor: Cary Sullivan Technical Editor: Simon St. Laurent Production Editor: Anthony Washington Associate Production Editor: Ann Chen 'Fain would I dwell on form ..." — William Shakespeare, Romeo andJuliet, Il.ii "This may seem a bit weird, but that's okay, because it is weird." — Larry Wall, author of Perl, in the Perl manual i Contents Introduction x\ CHAPTER I: Prelude to CGI I Saying Hello the Old-Fashioned Way 2 Behind the Scenes I: A Web Page 4 Scripting: When a Simple Hello Isn't Enough 8 Behind the Scenes II: Web Pages with CGI 9 Recognizing a Script When You SeeIt 12 Review: Basics ofWeb Communication 16 CHAPTER 2: CGI Introductions with Perl 19 Peri Basics 20 Easier Introductions: Hello World with Functions 21 Perl VariablesPartI: Scalars 25 How the Magic Works 26 Simple Subroutines 26 Perl VariablesPartII: Arrays 28 Parameter Passing 29 CONTENTS viii Notable Quotes 32 Bonjour le monde 34 Perl VariablesPartIII: AssociativeArrays 36 We Know Where You Live 39 Munging 40 Decisions, Decisions: Flow Control 50 Review: Perl and CGI 52 CHAPTER 3: Form and Function 53 Formal Introductions 54 The <form> Element 55 Text and Password Fields 60 Radio Buttons and Checkboxes 6l Scripting 63 A <form> Lener 68 The <select> and <option> Elements 75 Multiple-line Text Areas 77 Submit and Reset 78 Comboform Processing 80 Origins ofInscrutability 81 But Wait, There's More! 87 Images 87 File Upload 88 Hidden Elements 89 Next Steps 90 Review: Scripting with Forms 92 CHAPTER 4: Controlling the Communication with HTTP and CGI 95 The Hypertext Transport Protocol 96

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.