The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified
Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners
https://goalkicker.com/
章节目录
1-1
Content list
1-2
About
1-3
Chapter 1: Getting started with Perl Language
1-4
Section 1.1: Getting started with Perl
1-5
Chapter 2: Comments
1-6
Section 2.1: Single-line comments
1-7
Section 2.2: Multi-line comments
1-8
Chapter 3: Variables
1-9
Section 3.1: Scalars
1-10
Section 3.2: Array References
1-11
Section 3.3: Scalar References
1-12
Section 3.4: Arrays
1-13
Section 3.5: Typeglobs, typeglob refs, filehandles and constants
1-14
Section 3.6: Sigils
1-15
Section 3.7: Hash References
1-16
Section 3.8: Hashes
1-17
Chapter 4: Interpolation in Perl
1-18
Section 4.1: What is interpolated
1-19
Section 4.2: Basic interpolation
1-20
Chapter 5: True and false
1-21
Section 5.1: List of true and false values
1-22
Chapter 6: Dates and Time
1-23
Section 6.1: Date formatting
1-24
Section 6.2: Create new DateTime
1-25
Section 6.3: Working with elements of datetime
1-26
Section 6.4: Calculate code execution time
1-27
Chapter 7: Control Statements
1-28
Section 7.1: Conditionals
1-29
Section 7.2: Loops
1-30
Chapter 8: Subroutines
1-31
Section 8.1: Creating subroutines
1-32
Section 8.2: Subroutines
1-33
Section 8.3: Subroutine arguments are passed by reference (except those in signatures)
1-34
Chapter 9: Debug Output
1-35
Section 9.1: Dumping with Style
1-36
Section 9.2: Dumping data-structures
1-37
Section 9.3: Data::Show
1-38
Section 9.4: Dumping array list
1-39
Chapter 10: Lists
1-40
Section 10.1: Array as list
1-41
Section 10.2: Assigning a list to a hash
1-42
Section 10.3: Lists can be passed into subroutines
1-43
Section 10.4: Return list from subroutine
1-44
Section 10.5: Hash as list
1-45
Section 10.6: Using arrayref to pass array to sub
1-46
Chapter 11: Sorting
1-47
Section 11.1: Basic Lexical Sort
1-48
Section 11.2: The Schwartzian Transform
1-49
Section 11.3: Case Insensitive Sort
1-50
Section 11.4: Numeric Sort
1-51
Section 11.5: Reverse Sort
1-52
Chapter 12: File I/O (reading and writing files)
1-53
Section 12.1: Opening A FileHandle for Reading
1-54
Section 12.2: Reading from a file
1-55
Section 12.3: Write to a file
1-56
Section 12.4: "use autodie" and you won't need to check file open/close failures
1-57
Section 12.5: Rewind a filehandle
1-58
Section 12.6: Reading and Writing gzip compressed files
1-59
Section 12.7: Setting the default Encoding for IO
1-60
Chapter 13: Reading a file's content into a variable
1-61
Section 13.1: Path::Tiny
1-62
Section 13.2: The manual way
1-63
Section 13.3: File::Slurp
1-64
Section 13.4: File::Slurper
1-65
Section 13.5: Slurping a file into an array variable
1-66
Section 13.6: Slurp file in one-liner
1-67
Chapter 14: Strings and quoting methods
1-68
Section 14.1: String Literal Quoting
1-69
Section 14.2: Double-quoting
1-70
Section 14.3: Heredocs
1-71
Section 14.4: Removing trailing newlines
1-72
Chapter 15: Split a string on unquoted separators
1-73
Section 15.1: parse_line()
1-74
Section 15.2: Text::CSV or Text::CSV_XS
1-75
Chapter 16: Object-oriented Perl
1-76
Section 16.1: Defining classes in modern Perl
1-77
Section 16.2: Creating Objects
1-78
Section 16.3: Defining Classes
1-79
Section 16.4: Inheritance and methods resolution
1-80
Section 16.5: Class and Object Methods
1-81
Section 16.6: Roles
1-82
Chapter 17: Exception handling
1-83
Section 17.1: eval and die
1-84
Chapter 18: Regular Expressions
1-85
Section 18.1: Replace a string using regular expressions
1-86
Section 18.2: Matching strings
1-87
Section 18.3: Parsing a string with a regex
1-88
Section 18.4: Usage of \Q and \E in pattern matching
1-89
Chapter 19: XML Parsing
1-90
Section 19.1: Parsing with XML::Twig
1-91
Section 19.2: Consuming XML with XML::Rabbit
1-92
Section 19.3: Parsing with XML::LibXML
1-93
Chapter 20: Unicode
1-94
Section 20.1: The utf8 pragma: using Unicode in your sources
1-95
Section 20.2: Handling invalid UTF-8
1-96
Section 20.3: Command line switches for one-liners
1-97
Section 20.4: Standard I/O
1-98
Section 20.5: File handles
1-99
Section 20.6: Create filenames
1-100
Section 20.7: Read filenames
1-101
Chapter 21: Perl one-liners
1-102
Section 21.1: Upload file into mojolicious
1-103
Section 21.2: Execute some Perl code from command line
1-104
Section 21.3: Using double-quoted strings in Windows one-liners
1-105
Section 21.4: Print lines matching a pattern (PCRE grep)
1-106
Section 21.5: Replace a substring with another (PCRE sed)
1-107
Section 21.6: Print only certain fields
1-108
Section 21.7: Print lines 5 to 10
1-109
Section 21.8: Edit file in-place
1-110
Section 21.9: Reading the whole file as a string
1-111
Chapter 22: Randomness
1-112
Section 22.1: Accessing an array element at random
1-113
Section 22.2: Generate a random integer between 0 and 9
1-114
Chapter 23: Special variables
1-115
Section 23.1: Special variables in perl:
1-116
Chapter 24: Packages and modules
1-117
Section 24.1: Using a module
1-118
Section 24.2: Using a module inside a directory
1-119
Section 24.3: Loading a module at runtime
1-120
Section 24.4: CPAN.pm
1-121
Section 24.5: List all installed modules
1-122
Section 24.6: Executing the contents of another file
1-123
Chapter 25: Install Perl modules via CPAN
1-124
Section 25.1: cpanminus, the lightweight configuration-free replacement for cpan
1-125
Section 25.2: Installing modules manually
1-126
Section 25.3: Run Perl CPAN in your terminal (Mac and Linux) or command prompt (Windows)
1-127
Chapter 26: Easy way to check installed modules on Mac and Ubuntu
1-128
Section 26.1: Use perldoc to check the Perl package install path
1-129
Section 26.2: Check installed perl modules via terminal
1-130
Section 26.3: How to check Perl corelist modules
1-131
Chapter 27: Pack and unpack
1-132
Section 27.1: Manually Converting C Structs to Pack Syntax
1-133
Section 27.2: Constructing an IPv4 header
1-134
Chapter 28: Perl commands for Windows Excel with Win32::OLE module
1-135
Section 28.1: Opening and Saving Excel/Workbooks
1-136
Section 28.2: Manipulation of Worksheets
1-137
Section 28.3: Manipulation of cells
1-138
Section 28.4: Manipulation of Rows / Columns
1-139
Chapter 29: Simple interaction with database via DBI module
1-140
Section 29.1: DBI module
1-141
Chapter 30: Perl Testing
1-142
Section 30.1: Perl Unit Testing Example
1-143
Chapter 31: Dancer
1-144
Section 31.1: Easiest example
1-145
Chapter 32: Attributed Text
1-146
Section 32.1: Printing colored Text
1-147
Chapter 33: GUI Applications in Perl
1-148
Section 33.1: GTK Application
1-149
Chapter 34: Memory usage optimization
1-150
Section 34.1: Reading files: foreach vs. while
1-151
Section 34.2: Processing long lists
1-152
Chapter 35: Perl script debugging
1-153
Section 35.1: Run script in debug mode
1-154
Section 35.2: Use a nonstandard debugger
1-155
Chapter 36: Perlbrew
1-156
Section 36.1: Setup perlbrew for the first time
1-157
Chapter 37: Installation of Perl
1-158
Section 37.1: Linux
1-159
Section 37.2: OS X
1-160
Section 37.3: Windows
1-161
Chapter 38: Compile Perl cpan module sapnwrfc from source code
1-162
Section 38.1: Simple example to test the RFC connection