Data Types
 
Data Types
  • Scalars
     
  • Arrays & Lists
     
  • Hashes
     
  • References
     
  • Filehandles
It's all about context
  • Perl is smart enough to know how you're using something
     
  • Numerics can be strings; strings can be numerics
     
  • Arrays can be scalars
     
  • Hashes can be arrays
     
  • Arrays can be hashes
Scalars
  • Single value
     
  • Arbitrary large
     
  • Can contain binary data, even nulls.
     
  • Can be numeric or string, depending on context
Arrays/Lists
  • Arbitrary-sized array of scalars
     
  • Can contain any scalar
     
  • Used when you want to preserve order of something
Hashes
  • Collection of scalars
     
  • Keyed by a unique case-sensitive string
     
  • Useful for lookups or checking for existence
     
  • Same as associative arrays in awk, or the CMap class in MFC.
References
  • Is a scalar, and can be used anywhere a scalar can
     
  • Perl version of pointers
Index
Introduction
What Is Perl?
Perl Resources
Running a Perl Program
Perl Thinking
Data Types
Scalars
Strings: Single Quoted
Strings: Double Quoted
Scalar operations
Scalar comparisons
Variables
Lists
Using Lists
Control Structures
Hashes
Hash Manipulation
File Handling
Regex Matching
Regex Matching: Ex. 1
Regex Matching: Ex. 2
Regex Replacing
Subroutines
Anonymous subs
References
Structures
Modules
Modules: File::Find
Modules: Internet
Modules: Win32::*
Everything Else
  Next page >>>