Cargando…

Advanced Perl programming : from advanced to expert /

William Rothwell's Advanced Perl Programming continues where his previous book left off, more or less, as it guides you through advanced techniques of the Perl programming language starting with command-line options, references, and arrays and hashes from advanced data types. Next, you'll...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Rothwell, William
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Berkeley, CA : Apress L.P., 2020.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Intro
  • Table of Contents
  • About the Author
  • About the Technical Reviewer
  • Acknowledgments
  • Chapter 1: Command-Line Options
  • Changing input record separator
  • Create a loop around your script
  • Looping and printing
  • Looping and parsing
  • Editing in place
  • Flexibility in backup filenames
  • Backing up to different directories
  • Syntax checking
  • Pre-appending to @INC
  • Manipulate @INC at compile time
  • Using the -I option
  • Including modules
  • Using -M to load specific identifiers from modules
  • Alternative syntax to -M
  • Command-line parsing
  • Displaying configuration information
  • Extracting scripts from messages
  • Handling extra text after end of script
  • Additional resources
  • Lab exercises
  • Chapter 2: References
  • Creating references
  • Returning the value from a reference
  • Other methods of referencing arrays
  • Arrays of scalar references
  • Another method of referencing hashes
  • The ref function
  • Making anonymous references
  • Method #1
  • Method #2
  • Method #1
  • Method #2
  • References to functions
  • use strict'refs'
  • Making use of symbolic references
  • Additional resources
  • Lab exercises
  • Chapter 3: Advanced Data Types: Arrays
  • What you should already know about arrays
  • Creating arrays
  • Returning values in arrays
  • Adding and removing elements in an array
  • Looping through the array
  • Array operators
  • The reverse operator
  • The sort operator
  • The qw operator
  • Array separator variable
  • Regular expression matching with grep
  • What you might know about arrays
  • Changing #array changes the size of the array
  • Arrays returned in scalar context returns the number of elements in the array
  • Changing the variable in a foreach loop changes the array elements
  • The _ variable is used by default in a foreach loop
  • The foreach loop and for loops are the same thing
  • Arrays of arrays
  • Method #1
  • Make an array for each data type
  • Method #2
  • Make an array for each transaction
  • Method #3
  • Make an array of arrays
  • Creating arrays of arrays
  • Rows and columns
  • Creating a multi-dimensional array from STDIN
  • Accessing values in an array of arrays
  • Adding a subarray (row)
  • Adding a column
  • Printing an array of arrays
  • Additional resources
  • Lab exercises
  • Chapter 4: Advanced Data Types: Hashes
  • What you should already know about hashes
  • Creating associative arrays
  • Accessing values in an associative array
  • Removing associative array keys and values
  • exists vs. defined
  • What you might know about hashes
  • Keeping order in hashes
  • Additional useful hash modules
  • Inverting a hash: method #1
  • Inverting a hash: method #2
  • Hashes of hashes
  • Approach #1
  • Make four arrays, one for each student
  • Approach #2
  • Make three associative arrays, one for each test
  • Approach #3
  • Make a hash of hashes
  • Creating hashes of hashes
  • Accessing values in a hash of hashes