Chapter 3. Perl as a (better) grep command
A brief history of | ||
Shortcomings of | ||
Working with the matching operator | ||
Understanding Perl’s regex notation | ||
Perl as a better | ||
Displaying the match only, using | ||
Displaying unmatched records (like | ||
Displaying filenames only (like | ||
Using matching modifiers | ||
Perl as a better | ||
Matching in context | ||
Spanning lines with regexes | ||
Additional examples | ||
Summary |
This chapter shows you how to write one-line Perl commands and small Perl scripts that surpass the limitations of the UNIX grep
command. We’ll start by reviewing grep
’s history, strengths, and weaknesses, and Perl’s superior features, and then we’ll show how Perl programs ...
Get Minimal Perl now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.