Advanced Programming

Perl has evolved from its beginnings as an eclectic scripting tool for UNIX administrators into one of the most popular, influential, and widely used computer languages in history. In this course, you will learn how to fully utilize the Perl .

Audience: Application programmers, system administrators, web-site authors, webmasters, and UNIX/NT power users.

Prerequisites: Perl Programming and Perl application development experience. Full comprehension of the extending and embedding material will require some or C++ programming experience.

Number of Days: 4 days

1. Debugging The Block Form of eval Warnings The String Form of eval Diagnostic Messages Block Form of eval for Exception Carping, Confessing, and Croaking Handling Strict Checks 4. Packages Compiler Pragmas Review of Packages Debugging Flags BEGIN and END Blocks Your Perl Configuration Symbol Tables The Devel::Peek Module Package Variables The Data::Dumper Module Calling Package Subroutines 2. Expert List Manipulation Importing Package Symbols The grep Operator Exporting Package Symbols Lists, Arrays, and List Operators Using the Exporter Package Context The use Function Context and Subroutines AUTOLOAD and @ISA Initializing Arrays and Hashes AutoLoader and SelfLoader Reference Syntax 5. Objects and Classes Auto-vivification Object-Oriented Stuff Defined Values Making Perl Object-Oriented Other List Operators References Usage of map, grep, and foreach The bless Function 3. Blocks and Code References So, What's a Blessed Thing Good For? Blocks Calling Class and Object Methods Subroutines Object Methods Subroutine Prototypes Writing Classes Code Refs and Anonymous Subroutines Constructors Typeglobbing for the Non-Squeamish Inheritance Local (Dynamic) Variables What Perl Doesn't Do Lexical Variables 6. Tied Variables Persistent Private Subroutine Variables Why Use tie? Closures Tying a Scalar The eval Operator Inside Tied Variables

© ITCourseware, LLC 1 Advanced Perl Programming Rev 3.1.2

untie Adding Widgets Tying an Array Scrolled Widgets Tying Hashes Configuring Widgets Tie::Hash and Tie::Array Menus Tying Filehandles More Fun with Menus What Are DBM, NDBM, GDBM, Using FileSelect SDBM, etc? 11. Perl/Tk Programming Using the DBM Modules Tk::Error and Tk::ErrorDialog 7. Installing and Using Perl Modules Configuring Widgets Laziness, Impatience, and Hubris Geometry Management CPAN Geometry Management with grid() Using Modules The Frame Widget Installing a Defining Widget Callbacks Unpacking the Module Source Bindings The Configuration Step Nonblocking I/O with fileevent() The Build Step Tags The Test Step Other Widgets The Install Step Other Tk Commands Using CPAN.pm Getting Tk Using Module Documentation 12. Extending Perl with C/C++ 8. Introduction to DBI/DBD Extending the Perl The Old Way - DBPerls Overview of Perl5 XSUBs A Better Way - DBI/DBD Get Started with h2xs Database Programming Set up the Perl Wrapper Class Handles Write the XS Code Connecting to the Database The XS File Creating a SQL Query Write Some Test Code Getting the Results What Do You Want? Updating Database Data Returning Values on the Stack Transaction Management A Walk through an XSUB Finishing Up Arguments to XSUBs 9. DBI/DBD SQL Programming Other h2xs Options Error Checking in DBI 13. Embedding the Perl Interpreter Getting Connected Why Embed Perl? Drivers Embedding Perl in a C Program Using Parameterized Statements Compiling the Program Statement Handle Attributes perlmain.c Other Handle Attributes Perl Data Types Column Binding Macros and Functions The do Method Manipulating Scalars BLOBs and LONGs and Such Memory Management Installing DBI Drivers Script Space 10. Introduction to Perl/Tk Evaluating Perl Expressions Tcl, Tk, Tcl/Tk, Tkperl, Perl/Tk, etc. Dynamic Loading Perl/Tk Multiple Perl Interpreters Creating a Perl/Tk Application GUI Programming Overview

© ITCourseware, LLC 2 Advanced Perl Programming Rev 3.1.2

14. Module Development and Distribution Distributing Modules Get Started with h2xs Files Created by h2xs The Build Library (blib) Directory Unit Testing and test.pl Versions Using blib POD POD Translators Cutting a Distribution Other Niceties Makefile.PL 15. Design and Implementation Think First Object-Oriented Design Object-Oriented Development Library Modules Utility Programs Filters Performance Timing with Benchmark

© ITCourseware, LLC 3 Advanced Perl Programming Rev 3.1.2