O'Reilly Open Source Convention
oreilly.comO'Reilly Network
ConferencesSoftwareInternational


Arrow Home
Arrow Registration
Arrow Hotel/Travel
Arrow See & Do
Arrow Tutorials
Arrow Sessions
Arrow Evening Events
Arrow BOFs
Arrow Speakers
Arrow Press
Arrow Mail List
Arrow Exhibitors
Arrow Sponsors
Innovate--Collaborate--Discover
O'Reilly Open Source Convention
Sheraton San Diego Hotel, San Diego, CA
July 23-27, 2001

News Coverage

Tutorial

Mastering Perl Data Structures and References

Paul Grassie, Tom Christiansen Perl Consultancy

Track: Perl Conference 5
Date: Tuesday, July 24
Time: 8:45am - 12:15pm
Location: Grande Ballroom B

TARGET AUDIENCE:
Programmers with moderate experience in Perl who need to master the essentials of using references and creating data structures for various applications.

WHAT ATTENDEES WILL LEARN:
This tutorial provides a detailed examination of Perl references and data structures, features that many Perl programmers poorly understand yet stand to gain the most benefit from.

Examples will cover a wide range of crucial techniques in Perl including the use of anonymous arrays and hashes, multidimensional data structures, autovification, anonymous subroutines and closures. In addition, the important role-played by references in object oriented Perl will be introduced.

TUTORIAL OUTLINE:

  • Introduction
    • What are references and why are they useful?
    • What kinds of data structures does Perl support?
    • Using a hash as a data structure
  • Syntax of References
    • Creating references
    • Dereferencing references
    • An array of references
    • Checking your references
    • Anonymous arrays and hashes
    • Multidimensional arrays and hashes
    • Complex data structures
  • Applying Data Structures and References
    • Printing data structures using Data::Dumper
    • Saving and restoring data structures using Data::Dumper
    • Building data structures on the fly
      • Creating an array of anonymous hashes
      • Faster sorting using the Schwartzian Transform
    • Autovivifying arrays, hashes, and filehandles
    • Creating multi-valued hashes using autovivification
  • Creating the Right Data Structure for the Job
    • Example: reporting cities by state
    • Example: reversing the mapping of a hash
    • Example: accumulating totals
    • Example: indexing records
  • References and Subroutines
    • Controlling the scope of data structures
    • Passing arrays, hashes and filehandles to subroutines
    • Returning references to private variables
    • Creating subroutine references
    • Anonymous subroutines
    • Callback subroutines
    • Closures
  • References and Object Oriented Perl
    • Blessing objects
    • Using references as objects
    • Example of a hash-based object
    • Example of an array-based object

oreilly.com Home | Conferences Home | Open Source Convention Home
Registration | Hotels/Travel | Tutorials | Sessions | Speakers
Press | Mail List | Exhibitors | Sponsors


© 2001, O'Reilly Media, Inc.
conftech@oreilly.com