Sei sulla pagina 1di 13

ISQT Confidential

Advanced Perl Scripting Recommended Duration : 4 days (32 hours @ 8 hours per day) Prerequisites:
Participants attending this training program should be competent in the following: Good experience in basic Perl programming language The basic knowledge of SQL, XHTML and JavaScript would be added advantage Fair knowledge of Windows/Linux/UNIX.

Lab requirements:
This training program is largely lab-oriented, where, each participant will have to try out various exercises provided by the instructor during the training Sessions. Most of the key concepts will be explained by instructor by writing and demonstrating scripts in real-time. The participants are also required to try the same. A computer installed with the following software should given to each participants who attending the training program. Perl 5.8.8 Apache HTTPD 2 MySQL 5.5 Lab should be equipped with LCD projector that can be connected to the laptop carried-in by the instructor. Whiteboard Marker and stationary (scribbling pad, pen for each participant) are mandatory.

ISQT Confidential

Course Content
Day 1
References Creating references. Scalar references. Array References Hash References Anonymous Variables and references Hash of Lists, Hash of Hashes. List variable interpolation. Using List references. Multi-dimensional Lists (Array-of-Arrays). Array of Hashes Common List programming pitfalls to avoid. Anonymous coderefs.

Objects and Classes Object-Oriented Stuff Making Perl Object-Oriented References The bless Function So, What's a Blessed Thing Good For? Calling Class and Object Methods

ISQT Confidential

Object Methods Writing Classes Constructors Inheritance What Perl Doesn't Do

Tied Variables Why Use tie? Tying a Scalar Inside Tied Variables untie Tying an Array Tying Hashes Tie::Hash and Tie::Array Tying File handles What Are DBM, NDBM, GDBM Using the DBM Modules

Packages Review of Packages BEGIN and END Blocks Symbol Tables Package Variables Calling Package Subroutines

ISQT Confidential

Importing Package Symbols Exporting Package Symbols Using the Exporter Package The use Function AUTOLOAD and @ISA

Installing and Using Perl Modules Laziness, Impatience, and Hubris CPAN Using Modules Installing a Perl Module Unpacking the Module Source The Configuration Step The Build Step The Test Step The Install Step Using CPAN.pm Using Module Documentation

Module Development and Distribution Distributing Modules Get Started with h2xs Files Created by h2xs The Build Library (blib) ulectory

ISQT Confidential

Unit Testing and test.pl Versions Using blib POD POD Translators Cutting a Distribution Other Niceties Makefile.PL

Day 2
Database Operations using Perl SQL Designing and Creating a Database Relational Database Design Principles Implementing the Design

Data Selection Queries Understanding Transact-SQL The SELECT Statement The WHERE Clause Using ORDER BY to Sort Data The GROUP BY Clause Joining Tables

ISQT Confidential

Modifying Data Modifying Data Inserting Data Updating Data Deleting Data Understanding Transaction

Introduction to DBI/DBD Database connectivity: introducing the DBI module Origins of DBI, the database interface module DBI architecture A Better Way - DBI/DBD Database Programming Handles Connecting to the Database Creating a SQL Query Getting the Results Updating Database Data Transaction Management Finishing Up

DBI/DBD SQL Programming Error Checking in DBI Getting Connected

ISQT Confidential

Drivers Using Parameterized Statements Statement Handle Attributes Other Handle Attributes Column Binding Installing DBI Drivers

Perl and XML ( 2:30 hours) SAX simple API for XML XML::Parser::PerlSAX XML::SAX::ParserFactory Process XML tree with XML::DOM Process XML tree with XML::LibXML Query XML data with XPATH language XML::XPATH module XSL transformations from XML into HTML Axkit for server side XML processing Perl programs to access database and to generate XML from a database Perl programs that inserts into database tables from the XML file

Day 3
CGI Programming using Perl XHTML Introduction Introduction to XHTML What is XHTML?

ISQT Confidential

Differences between XHTML and HTML Required tags/ attributes for XHTML XHTML validation XHTML Document Structure CSS with XHTML Tables, Images, and Hyperlinks Hyperlinks: absolute, relative, fragment identifiers, and mailto: Images: common attributes for img tag, alignment, and hyperlinks using images Tables: Data tables versus formatting tables Forms and the Future of XHTML Forms: useful elements and attributes

JavaScript Introduction Introduction to JavaScript JavaScript core language Language syntax Data types Control flow constructs Objects Arrays Functions

Introducing Perl and CGI Origins of the language

ISQT Confidential

The difference between Perl and CGI The relationship between Perl and HTML Understanding the Web browser-Web server relationship The roles of CGI.pm and DBI.pm

Environment variables Your visitor's browser and platform Viewing available environment variables Storing data from environment variables

Getting data into the script Getting single-value form data Getting multiple-value form data Getting the names of all form elements Retrieving values from each of these element

Analyzing data and validating form submissions Why analyze data? In-depth primer on regular expressions, which enable simple or complex patterns to be detected within text strings Finding something Finding and replacing Seeing and using what was found Splitting a value into pieces Constructing search patterns Matching a single character

ISQT Confidential

Matching a string of characters Matching a character from a group Matching a character that's not in the group Using class shorthands Advanced regular expression techniques Form validation Client-side, server-side, or both? Defining validation rules and analyzing submitted data Returning messages back to the user about whether their form submission is valid or invalid

Day 4
Remembering what visitors tell you Overview of strategies for maintaining user information and application state Using hidden fields to store and pass data Using cookies to store and pass data Setting a cookie Restricting a cookie by domain and/or path Setting the expiration of a cookie Requiring the presence of a secure connection Retrieving and working with cookie values What to do when a user's browser refuses to accept a cookie

ISQT Confidential

Formatting output with HTML Overview of CGI.pm's capabilities for automatically-generating HTML Generating the HTTP header Using start_html() to generate the document head Concluding the page with end_html() Dynamically generating text and tables of text Dynamically generating hyperlinks and images Dynamically generating forms Styling output with CSS

CGI/Perl security an Introduction Reading the security FAQs The problem with visitor input Protecting calls to the system Limiting access to files Using CGI.pm to limit incoming data Keeping information to yourself Avoiding tainted data

Processing file uploads Why upload files via HTML forms? Setting the enctype and method of the form to facilitate uploads Defining one or more file fields in the form Controlling where the uploaded file is saved Preventing common security issues that can arise when saving uploaded files

ISQT Confidential

Dynamic Web application using Perl CGI and MySQL Server Selecting records from the database via ad hoc queries Building a SQL SELECT statement Sending the SQL statement to the database for execution Displaying a single value returned from the database Displaying multiple rows of data returned from the database Handling errors that can occur when interacting with the database Inserting, updating, and deleting records Building SQL INSERT, UPDATE, and DELETE statements Building Web-based interfaces for inserting, updating, and deleting database records Validating user input Prompting the user for confirmation Grouping related operations together as transactions so that they either all succeed or all fail Cleaning and using outside data

Testing Beginning Testing Installing Test Modules Running Tests Interpreting Test Results Writing Your First Test Loading Modules

ISQT Confidential

Improving Test Comparisons Writing Tests

Testing Exceptions Managing Tests

Potrebbero piacerti anche