Intermediate Perl Programming by bzs12927

VIEWS: 15 PAGES: 2

									Intermediate Perl Programming

Introduction..................................................................................................................................... 1
    Creating a Template.................................................................................................................. 1

Subroutines ..................................................................................................................................... 2
   Arguments................................................................................................................................. 3

Exercise 1........................................................................................................................................ 6

File Access and Manipulation......................................................................................................... 8
    Testing Files.............................................................................................................................. 8
    Accessing a File ........................................................................................................................ 8

Directory Access and File Manipulation ...................................................................................... 13

Exercise 2...................................................................................................................................... 14

Introduction to Packages, Modules, and Pragmas ........................................................................ 16
    Packages.................................................................................................................................. 16
    Modules................................................................................................................................... 17
    Pragma .................................................................................................................................... 19

Exercise 3...................................................................................................................................... 20

Connecting to Databases............................................................................................................... 21
   System Configuration ............................................................................................................. 21
   Perl Database Interface ........................................................................................................... 21
   DBI Connection Example ....................................................................................................... 22
   Automatic Error Reporting ..................................................................................................... 24
   Fetching Data .......................................................................................................................... 25

Creating ODBC Connections........................................................................................................ 26
   Setting Up a DSN.................................................................................................................... 27
   Connecting to a Database using ODBC.................................................................................. 27

Exercise 4...................................................................................................................................... 31

Modifying Tables Using SQL Statements in Perl ........................................................................ 32
  Additional Statements............................................................................................................. 32
  Counting Rows........................................................................................................................ 33
  Inserting Records .................................................................................................................... 34
  Updating Records.................................................................................................................... 35
  Deleting Records..................................................................................................................... 36

Exercise 5...................................................................................................................................... 37


Intermediate Perl Programming                                                                                                               1/6/10
www.cetc.umsl.edu
Web Interfaces .............................................................................................................................. 38
  Receiving the Data.................................................................................................................. 38
  Processing the Data................................................................................................................. 39
  Using the CGI Module............................................................................................................ 39
  Using CGI with Database Connections .................................................................................. 41

Exercise 6...................................................................................................................................... 43

Appendix A: Meta Characters ...................................................................................................... 44

Appendix B: Solutions to Exercises ............................................................................................. 45




Intermediate Perl Programming
www.cetc.umsl.edu

								
To top