You are looking at a very old, but free version of the course. If you are interesed the most recent version, check it out on the Perl Maven site.

Fundamentals of Perl

Gabor Szabo


Table of Contents
2. Introduction
2.1. Self Introduction - Who am I ?
2.2. Self Introduction - Who are you ?
3. Preface
3.1. Content
4. First steps
4.1. Installation
4.2. Editors, IDEs
4.3. Environment
4.4. Safety net
4.5. Comments
4.6. Perl documentation
4.7. POD - Plain Old Documentation
4.8. Exercise: Hello world
5. Scalars
5.1. Numbers - integers, real or floating-point
5.2. Scalar variables (use my)
5.3. Greeting with a name, Variable interpolation
5.4. User Input
5.5. chomp
5.6. Numerical Operators
5.7. String Operators
5.8. Dividing two numbers given by the user
5.9. Fixing the problem: Conditional statements: if
5.10. Syntax of if statement
5.11. Comparison operators
5.12. String - Number conversion
5.13. Compare values
5.14. Compare values - examples
5.15. Boolean expressions (logical operators)
5.16. TRUE and FALSE
5.17. Your Salary is in Danger - Short-Circuit
5.18. String functions
5.19. String functions
5.20. Strings - Double quoted
5.21. Strings - Single quoted
5.22. Scope of variables
5.23. Random numbers
5.24. Exercises: Simple Calcualtor
5.25. Number Guessing game
5.26. Solution: Simple Calulator
5.27. Solution: Simple Calulator (using eval)
6. Files
6.1. die, warn, exit
6.2. Opening file for reading
6.3. Opening a file
6.4. Opening a file - error handling
6.5. Opening a missing file
6.6. Read one line from a file
6.7. Process an entire file line by line (while, cat)
6.8. Write to a file
6.9. Sum of numbers in a file
6.10. Analyze the Apache log file
6.11. Open files in the old way
6.12. Exercise: Add more statistics
6.13. Exercise: Write report to file
6.14. Exercise: Analyze Apache - number of successful hits
6.15. Solution: Add more statistics
6.16. Solution: Analyze Apache - number of successful hits
6.17. Solution: Write report to file
7. Lists and Arrays
7.1. List Literals, list ranges
7.2. List Assignment
7.3. loop over elements of list with foreach
7.4. Create an Array, loop over with foreach
7.5. Array Assignment
7.6. foreach loop on numbers
7.7. Array index (menu)
7.8. Command line parameters
7.9. Process command line parameters, use modules
7.10. Module documentation
7.11. process csv file
7.12. process csv file (short version)
7.13. process csv file using Text::CSV_XS
7.14. Join
7.15. Exercise: improve the color selector
7.16. Improve the Number Guessing game from the earlier chapter
7.17. Solution: improved color selector
8. Advanced Arrays
8.1. The year 19100
8.2. SCALAR and LIST Context
8.3. Context Sensitivity
8.4. Filehandle in scalar and list context
8.5. slurp mode
8.6. File::Slurp
8.7. pop, push
8.8. stack (pop, push)
8.9. shift, unshift
8.10. queue (shift, push)
8.11. shift
8.12. sort, reverse
8.13. Advanced sort
8.14. Ternary operator
8.15. Count digits
8.16. $_
8.17. Diamond operator
8.18. Exercise: median and standard deviation
8.19. Exercise: sort mixed string
8.20. Solution: median and standard deviation
8.21. Solution: sort mixed strings
8.22. grep
8.23. map
8.24. List::Util
8.25. Advanced: Multi dimensional array
8.26. splice
9. Functions and Subroutines
9.1. Subroutines
9.2. Recoursive subroutines
9.3. Sort using a function
9.4. Return a list
9.5. Error handling with eval
10. Associative Arrays (Hashes)
10.1. What is a hash?
10.2. Uses of hashes
10.3. Creating hashes
10.4. Create hash from an array
10.5. Hash in scalar context
10.6. Fetching data from hash
10.7. exists, delete hash element
10.8. Multi dimensional hashes
10.9. Dumping hashes
10.10. Count words
10.11. Exercise: Parse HTTP values
10.12. Exercise: Improve the color selector
10.13. Exercise: Display scores
10.14. Exercise: Analyze Apache log file
10.15. Exercise: Parse variable width fields
10.16. Solution: Parse HTTP values
10.17. Solution: Improve the color selector
10.18. Solution: Display scores
10.19. Solution: Analyze Apache log file
10.20. Solution: Parse variable width fields
11. Regular Expressions
11.1. What are regexes good for ?
11.2. Examples
11.3. Introduction to Regexes
11.4. Find a string in a file
11.5. Tools
11.6. Regex Examples: single character
11.7. Regex Examples dot (.)
11.8. Regex Examples (character class)
11.9. Regex Examples (^ in character class)
11.10. Regex Examples quantifiers
11.11. Quantifiers
11.12. Quantifiers on character classes
11.13. Exercises: Regular expressions
11.14. Solutions: Regular expressions
11.15. Grouping, alternatives
11.16. Capturing
11.17. Anchors
11.18. Character classes
11.19. Special character classes
11.20. Exercise: Number
11.21. Exercise: Hex/Oct/Bin
11.22. Exercise: Roman numbers
11.23. Solution: Number
11.24. Solution: Hex/Oct/Bin
11.25. Solution: Roman numbers
11.26. Regexp::Common
11.27. Options and modifiers
11.28. /i Case sensitivity
11.29. /m multiple lines
11.30. /s single line
11.31. /x enable whitespaces and comments
11.32. Substitute
11.33. Greedy quantifiers
11.34. minimal match
11.35. Replace spaces
11.36. Replace string in assembly code
11.37. split with regular expresion
11.38. Exercise: split CGI
11.39. Exercies: filename/dirname
11.40. Exercise: Sort SNMP numbers
11.41. Exercise: parse hours log file and give report
11.42. Exercise: Parse ini file
11.43. Exercise: parse perl file
11.44. Solution: Split CGI
11.45. Solution: filename/dirname
11.46. Solution: Sort SNMP numbers
11.47. Solution: parse hours log file and give report
11.48. Solution: Parse ini file
11.49. Solution: parse perl file
11.50. Regular Expressions Cheat sheet
12. Shell to Perl
12.1. Running External Programs
12.2. UNIX commands from the inside
12.3. File globbing (wildcards)
12.4. Rename files
12.5. Directory handles
12.6. File::HomeDir
12.7. More UNIX commands implemented in modules
12.8. More modules
12.9. Change Copyright text in every source file in a directory hierarchy
12.10. File::Tools
12.11. Exercise: Tree
12.12. Solutions: Tree
13. More about files
13.1. File test or -X operators
13.2. Reading from file, read, eof
13.3. tell, seek
13.4. truncate
13.5. UNIX file system, hard links symbolic links
13.6. stat, lstat
13.7. Exercise: Create a counter
13.8. Exercise: Create multiple counters
13.9. Exercises: List old logfiles
13.10. Solution: Create a counter
13.11. Solution: Create multiple counters
13.12. Solutions: List old logfiles
14. Using Perl modules, using CPAN
14.1. Using modules exporting functions
14.2. Using Object Oriented modules
14.3. Selecting Module to use
14.4. Installing modules on ActivePerl
14.5. Installing modules on Unix manually with root rights
14.6. Changing @INC
14.7. Using CPAN.pm
14.8. CPAN.pm
14.9. CPANPLUS, CPAN::Reporter
14.10. Exercise: Module installation
14.11. Solution: Module installation
15. Applications
15.1. Simple uses of Perl
15.2. Create Unix user account
15.3. Reporting file system diskspace usage (df)
15.4. Reporting diskspace usage on the mail server
15.5. A du like script
15.6. Send e-mail
15.7. Read Excel file
15.8. Process file with fixed width records
15.9. Process file with multiline records
15.10. Process multi field csv file
15.11. Fetch web page
15.12. Generate web page
15.13. Parse XML file
15.14. Database access using DBI and DBD::SQLite
15.15. Net::LDAP
15.16. Tie::File
16. Oneliners
16.1. Change encoding in a file
16.2. Replace file content
16.3. Process a csv file
A. Appendix
A.1. Resources, How to get support for Perl ?
A.2. Recommended Books
Table of Contents
List of Examples
4-1. examples/intro/hello_world.pl
4-2. examples/intro/documentation.pl
5-1. examples/scalars/scalar_variables.pl
5-2. examples/scalars/variable_interpolation.pl
5-3. examples/scalars/read_from_stdin.pl
5-4. examples/scalars/read_from_stdin_chomp.pl
5-5. examples/scalars/numerical_operators.pl
5-6. examples/scalars/autoincrement.pl
5-7. examples/scalars/string_operators.pl
5-8. examples/scalars/divide.pl
5-9. examples/scalars/if_conditional.pl
5-10. examples/scalars/string_number.pl
5-11. examples/scalars/compare_values.pl
5-12. examples/scalars/is_empty_string.pl
5-13. examples/scalars/string_functions.pl
5-14. examples/scalars/string_functions_substr.pl
5-15. examples/scalars/scope.pl
5-16. examples/scalars/random.pl
5-17. examples/scalars/basic_calculator.pl
5-18. examples/scalars/basic_calculator_eval.pl
6-1. examples/files/open_with_if.pl
6-2. examples/files/open_with_die.pl
6-3. examples/files/open_missing_file.pl
6-4. examples/files/read_line.pl
6-5. examples/files/cat.pl
6-6. examples/files/write_file.pl
6-7. examples/files/count_sum_write.pl
6-8. examples/files/apache_access.log
6-9. examples/files/apache_log_hosts.pl
6-10. examples/files/open_file_old.pl
6-11. examples/files/statistics.pl
6-12. examples/files/apache_log_result_code.pl
6-13. examples/files/write_report_to_file.pl
7-1. examples/arrays/list_colors.pl
7-2. examples/arrays/list_colors_array.pl
7-3. examples/arrays/color_menu.pl
7-4. examples/arrays/read_argv.pl
7-5. examples/arrays/process_command_line.pl
7-6. examples/arrays/process_csv_file.csv
7-7. examples/arrays/process_csv_file.pl
7-8. examples/arrays/process_csv_file_short.pl
7-9. examples/arrays/process_csv_file_module.csv
7-10. examples/arrays/process_csv_file_module.pl
7-11. examples/arrays/color_selector.pl
8-1. examples/arrays/filehandle_in_context.pl
8-2. examples/arrays/slurp.pl
8-3. examples/arrays/file_slurp.pl
8-4. examples/arrays/pop_push.pl
8-5. examples/arrays/reverse_polish_calculator.pl
8-6. examples/arrays/shift_unshift.pl
8-7. examples/arrays/queue.pl
8-8. examples/arrays/shift_argv.pl
8-9. examples/arrays/sort.pl
8-10. examples/arrays/count_digits.txt
8-11. examples/arrays/count_digits.pl
8-12. examples/arrays/diamond.pl
8-13. examples/arrays/sort_mixed_strings.txt
8-14. examples/arrays/statistics_more.pl
8-15. examples/arrays/sort_mixed_strings.pl
8-16. examples/arrays/grep_perl.pl
8-17. examples/arrays/map_perl.pl
8-18. examples/arrays/matrix.pl
8-19. examples/arrays/splice.pl
9-1. examples/subroutines/subroutines.pl
9-2. examples/subroutines/factorial.pl
9-3. examples/subroutines/fibonacci_recoursive.pl
9-4. examples/subroutines/sort_with_function.pl
9-5. examples/subroutines/fibonacci.pl
9-6. examples/subroutines/eval.pl
10-1. examples/hashes/grades.pl
10-2. examples/hashes/count_words_hash.pl
10-3. examples/hashes/score_data.txt
10-4. examples/hashes/variable_width_fields.log
10-5. examples/hashes/split_http.pl
10-6. examples/hashes/color_selector_file.pl
10-7. examples/hashes/score_data.pl
10-8. examples/hashes/apache_log_hosts_hash.pl
10-9. examples/hashes/parse_variable_width_fields.pl
11-1. examples/regex/find_string.pl
11-2. examples/regex/regex_exercise.pl
11-3. examples/regex/is_number.pl
11-4. examples/regex/is_base_number.pl
11-5. examples/regex/is_roman_number.pl
11-6. examples/regex/regexp_common.pl
11-7. examples/regex/regexp_common.txt
11-8. examples/regex/find_letter_change.pl
11-9. examples/regex/assembly_source.txt
11-10. examples/regex/assembly_process.pl
11-11. examples/regex/field_value_pairs.txt
11-12. examples/regex/parse_field_value_pairs.pl
11-13. examples/regex/snmp.txt
11-14. examples/regex/timelog.log
11-15. examples/regex/inifile.ini
11-16. examples/regex/split_cgi.pl
11-17. examples/regex/file_basename.pl
11-18. examples/regex/sort_snmp_numbers.pl
11-19. examples/regex/timelog.pl
11-20. examples/regex/parse_ini.pl
11-21. examples/regex/print_variables.pl
12-1. examples/shell/file_globbing.pl
12-2. examples/shell/rename_files.pl
12-3. examples/shell/list_directory.pl
12-4. examples/shell/file_homedir.pl
12-5. examples/shell/change_files.pl
12-6. examples/shell/tree.pl
12-7. examples/shell/tree_ff.pl
12-8. examples/shell/tree_file_find_rule.pl
13-1. examples/files/read_from_file.pl
13-2. examples/files/read_file.pl
13-3. examples/files/truncate.pl
13-4. examples/files/counter.pl
13-5. examples/files/multiple_counter.pl
13-6. examples/shell/logfiles_older_than3days.txt
13-7. examples/shell/list_old_log_files.pl
14-1. examples/cpan/math_bigint.pl
14-2. examples/cpan/ENV
14-3. examples/cpan/MyConfig.pm
14-4. examples/cpan/acme_camel.pl
15-1. examples/applications/create_user.pl
15-2. examples/applications/diskspace.pl
15-3. examples/applications/diskusage.pl
15-4. examples/applications/du.pl
15-5. examples/applications/sendmail.pl
15-6. examples/applications/read_excel.pl
15-7. examples/applications/pack.pl
15-8. examples/applications/pack.txt
15-9. examples/applications/config.txt
15-10. examples/applications/process_config.pl
15-11. examples/applications/fields.csv
15-12. examples/applications/process_fields.pl
15-13. examples/applications/get_webpage.pl
15-14. examples/applications/html.tmpl
15-15. examples/applications/html.pl
15-16. examples/applications/simple.xml
15-17. examples/applications/xml_simple.pl
15-18. examples/applications/db.pl
15-19. examples/applications/ldap.pl
15-20. examples/applications/tie.pl

If you are interested in on-site trainings by the author, please contact me directly.