Skip to main content
Top

2020 | Book

Pro Perl Programming

From Professional to Advanced

insite
SEARCH

About this book

Master intermediate to advanced techniques of the Perl programming language starting with a focus on regular expressions and some of their advanced features. This book then covers other pro-level features, including formatted output, file handling, and more.

Additionally, you'll learn and explore the most useful built-in variables, pragmas, and modules available in the Perl language. Furthermore, you'll work with geometry managers and get a thorough treatment of graphical user interface development using Perl/TK and widgets. Lastly, you’ll cover debugging techniques.

Pro Perl Programming is a professional-level reference guide on Perl and includes important aspects of it that you need as a professional programmer.

What You Will Learn

Program regular expressions including atoms, smartmatch operators, and more Use advanced features such as HiRes Time, slurp() functions, Critic, Tidy and many more functions Handle advanced formatted output such as printf and sprintf Explore useful built-in variables, including status variables, separator variables, and the signal handle variable Explore and use Perl's built-in modules, including the Pragma modules Work with Perl/TK and its widgets-like geometry managers, frames, labels, buttons, check buttons, radio buttons, scrollbars, scales, entries, and menus

Who This Book Is For

Those with at least some prior experience with Perl programming or have read Beginning Perl Programming by William Rothwell.

Table of Contents

Frontmatter
Chapter 1. Intermediate Regular Expressions
Abstract
Many people consider Perl to stand for Practical Extraction and Report Language. This isn't strictly true as Larry Wall originally wanted to call the language Pearl, but he discovered there was already a language that went by that name (PEARL, or Process and experiment automation realtime language, a language created about ten years before Perl).
William “Bo” Rothwell
Chapter 2. Advanced Regular Expressions
Abstract
So, you think you know a lot about Perl Regular Expressions? If you finished Chapter 1, then you certainly do. But, there are more REs that provide you with powerful techniques to parse data.
William “Bo” Rothwell
Chapter 3. Advanced Features
Abstract
Consider this chapter a collection of useful advanced tips to help you create better Perl programs. Each section will begin with a brief description of why you should use the feature or tool, followed by more detailed examples.
William “Bo” Rothwell
Chapter 4. Advanced Formatted Output
Abstract
Recall that many people consider Perl to stand for Practical Extraction and Report Language. You may be wondering what part of Perl performs the "Report" functionality. There are several features that provide this functionality as you will see in this chapter.
William “Bo” Rothwell
Chapter 5. Exploring Useful Built-in Variables
Abstract
A good deal of the power and flexibility behind Perl lies in its "built-in" variables. Perl's built-in variables provide many functions:
William “Bo” Rothwell
Chapter 6. Advanced File Handling
Abstract
File handling is the process of working with data that either originates from an external source (typically a file) or is to be sent to an external destination. Perl offers several features related to file handling that are covered in this chapter.
William “Bo” Rothwell
Chapter 7. Pragmas
Abstract
The intent behind pragmas is to modify the behavior of your Perl script. Pragmas are invoked with the use statement:

use strict;
William “Bo” Rothwell
Chapter 8. Exploring Useful Built-in Modules
Abstract
Years ago, while assisting a client with a Perl program, the client demonstrated a function that he was very proud of. The purpose of this function was to overcome the limitations of Perl and allow for larger floating point numbers. The code itself was a few hundred lines long, took weeks of work, and was still a bit buggy.
William “Bo” Rothwell
Chapter 9. Debugging Tools
Abstract
A fundamental part of programming is debugging code. This includes not only your own code but often code written by other people. You might be sent some code to debug by a fellow programmer, or download one of the thousands of modules from cpan.​org (one which, unfortunately, doesn't work quite as expected).
William “Bo” Rothwell
Chapter 10. Perl/TK Basics
Abstract
The idea behind Tk is to create an easy-to-use interface between Perl and Windows. In order to do this, Tk builds on top of the X Window System (or Microsoft Windows) to create "sub-windows" that contain buttons, menu bars, scroll bars, and other windows components. These components are called widgets.
William “Bo” Rothwell
Chapter 11. Perl TK Widgets
Abstract
The heart of TK are the widgets. Widgets are window-based components that allow the user to interact with the program. This chapter will focus on some of the more commonly used Perl TK widgets, but keep in mind that there are additional, often more advanced, widgets that you can explore on your own if you decide that you want to make some more advanced TK-based programs.
William “Bo” Rothwell
Chapter 12. Geometry Managers
Abstract
During the last two chapters, the focus has been on creating widgets. Now we will focus on how to place (manipulate) widgets in the window. The pack command is used to determine where widgets go and how big they will be.
William “Bo” Rothwell
Backmatter
Metadata
Title
Pro Perl Programming
Author
William "Bo" Rothwell
Copyright Year
2020
Publisher
Apress
Electronic ISBN
978-1-4842-5605-3
Print ISBN
978-1-4842-5604-6
DOI
https://doi.org/10.1007/978-1-4842-5605-3

Premium Partner