Cargando…

Scripting with Objects A Comparative Presentation of Object-Oriented Scripting with Perl and Python.

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Kak, Avinash C.
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Newark : John Wiley & Sons, Incorporated, 2008.
Colección:New York Academy of Sciences Ser.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Intro
  • Scripting with Objects: A Comparative Presentation of Object-Oriented Scripting With Perl and Python
  • Contents
  • Preface
  • Acknowledgments
  • 1 Multilanguage View of Application Development and OO Scripting
  • 1.1 Scripting Languages Versus Systems Programming Languages
  • 1.2 Organization of this Book
  • 1.3 Credits and Suggestions for Further Reading
  • 2 Perl
  • A Review of the Basics
  • 2.1 Scalar Values in Perl
  • 2.1.1 Numbers
  • 2.1.2 Strings
  • 2.2 Perl's Variables: Scalars, Arrays, and Hashes
  • 2.2.1 Scalar
  • 2.2.2 Array
  • 2.2.3 Hash
  • 2.3 Lexical Scope, Lexical Variables, and Global Variables
  • 2.3.1 Lexical Variables
  • 2.3.2 Package Variables
  • 2.4 Displaying Arrays
  • 2.5 Displaying Hashes
  • 2.6 Terminal and File I/O
  • 2.6.1 Terminal I/O
  • 2.6.2 File I/O
  • 2.6.2.1 I/O for Text Files
  • 2.6.2.2 I/O for Binary Files
  • 2.7 Functions, Subroutines, and Functions Used as Operators
  • 2.7.1 Using a Function as an Operator
  • 2.7.2 User-Defined Functions
  • 2.7.3 Passing Arguments to Functions
  • 2.7.4 Functions Can be Called with Keyword Arguments
  • 2.7.5 Default Values for Function Arguments
  • 2.8 What Is Returned by Evaluation Depends on Context
  • 2.9 Conditional Evaluation and Loop Control Structures
  • 2.9.1 Controlling an Outer Loop from an Inner Loop
  • 2.9.2 When Is a Conditional True or False?
  • 2.9.3 Complex Conditionals
  • 2.10 Functions Supplied with Here-Doc Arguments
  • 2.11 Modules and Packages in Perl
  • 2.11.1 Creating Your Own Module
  • 2.11.2 Importing Names from a Module
  • 2.11.3 ""Nesting"" of Modules
  • 2.11.4 The Autoloading Feature
  • 2.11.5 Package Constructors and Destructors
  • 2.12 Temporarily Localizing a Global Variable
  • 2.13 Typeglobs for Global Names
  • 2.13.1 Creating Global Variables by Direct Assignments to Typeglob Slots
  • 2.14 The eval Operator
  • 2.15 grep() and map() Functions
  • 2.16 Interacting with the Directory Structure
  • 2.16.1 Directory Handles
  • 2.16.2 File Tests
  • 2.16.3 Taking Advantage of Shell's Globbing
  • 2.16.4 Scanning a Directory Tree
  • 2.17 Launching Processes
  • 2.17.1 Launching a Child Process with system()
  • 2.17.2 Launching a Child Process with Backticks
  • 2.17.3 exec( ) for Transferring Control to a Process
  • 2.17.4 Launching a Child Process with fork()
  • 2.17.5 open( ) for Interprocess Communications
  • 2.18 Sending and Trapping Signals
  • 2.19 Credits and Suggestions for Further Reading
  • 2.20 Homework
  • 3 Python
  • A Review of the Basics
  • 3.1 Language Model: Perl versus Python
  • 3.2 Numbers
  • 3.3 Python Containers: Sequences
  • 3.3.1 Strings
  • 3.3.2 Tuples
  • 3.3.3 Lists
  • 3.3.4 Xrange Sequences
  • 3.4 Python Containers: Dictionaries
  • 3.5 Built-in Types as Classes
  • 3.5.1 String Type as a Class
  • 3.5.2 Numeric Types as Classes
  • 3.6 Subclassing the Built-in Types
  • 3.6.1 Subclassing the String Type
  • 3.6.2 Subclassing the Integer Type
  • 3.7 Terminal and File I/O