minimal perl for unix and linux people - manning 2006

495 853 0
minimal perl for unix and linux people - manning 2006

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... needlessly complex and too hard to learn Minimal Perl was created to address these obstacles presented by Perl s redundancy and complexity By emphasizing Perl s grep, sed, and awk-like features, and relying 1 Before you despair, I should point out that Minimal Perl uses only 2 of these variations—which is all anybody needs! xix on concepts such as inputs, filters, and arguments, it allows Unix1 users to... relatively conventional way of writing the code for a particular type of command, the examples use that style On the other hand, in cases where two different styles are in popular use, both are shown, as in these equivalent commands: [ -f "$file" [[ -f $file -a && -r "$file" -r $file -a && -s "$file" ] -s $file ]] || || exit 42; exit 42; xxxi Perl programs Perl allows the programmer to select from a variety... Looping-related differences between the Shell and Perl 332 The while/until loop 333 Pre- and post-processing in implicit and explicit loops 338 Perl s do while loop and its Shell equivalent 338 The Shell’s for loop and Perl s foreach loop 340 Perl s... confirmed my hunch that many were hungering for an easier way to learn Perl Since then, I’ve taught Minimal Perl at other professional conferences, at meetings of Perl Users Groups in the US and Canada, and to many Fortune 500 companies THE GENESIS OF THE BOOK By 2001, the Minimal Perl approach had convincingly proven its ability to help Unix people acquire Perl skills with relative ease But many who... 33 Shell and Perl techniques for writing messages to STDOUT and STDERR 36 Special variables for I/O operations 42 Special variables for formatting output 43 Standard option clusters for Perl commands and scripts 45 3.9 3.10 3.11 3.12 Chapter 3 String escapes for representing control... related Unix shells xxiii Part 1: Perl for UNIX and Linux users Part 1 gives those with at least user-level Unix skills—which includes even the most advanced programmers—a gentle introduction to the core elements of Minimal Perl After reading it, you’ll be able to write custom programs to do the most common types of data-processing tasks You’re assumed to be familiar with the most basic commands, file-management... behind the development of Minimal Perl and the philosophy underlying the special subset of the standard Perl language that it employs But before delving into those matters, we’ll begin our journey with a tale of travel that provides a helpful orientation to Perl culture 1.1 A VISIT TO PERLISTAN A Unix user visiting the world of Perl may feel like he’s in a foreign land, where people use words that sound... file-management techniques, and command formats used on Unix systems For example, you should know how to view the contents of text files, how to change the current directory without getting lost, and how to use the grep command to extract matching lines from a file Readers with more extensive backgrounds in Shell programming can especially benefit from part 2 Part 2: Perl for UNIX and Linux Shell programmers... understanding of Perl than almost anyone else To allow others to benefit from his insights, I arranged for him to periodically teach Perl classes through my Seattle-based company (Consultix) and also to present talks to our Seattle Perl Users Group (SPUG, aka Seattle.pm) This worked out wonderfully for Seattleites, who would learn practical Perl incantations 1 2 3 4 xx In this book, Unix is shorthand for. .. directive” of catering to UNIX and Shell sensibilities DOWNLOADING THE SOURCE CODE You can download the source code for many of the one-line commands and scripts presented in this book from Manning s website Follow the appropriate links from the http://www .manning. com/maher website to get them DEFAULT INVOCATION OPTIONS FOR PERL EXAMPLES For code snippets shown in tables and interspersed within the . h0" alt="" Minimal Perl For UNIX and Linux People BY TIM MAHER MANNING Greenwich (74° w. long.) For online information and ordering of this and other Manning books, please visit www .manning. com for UNIX and Linux Users 1 1 Introducing Minimal Perl 3 2 Perl essentials 16 3 Perl as a (better) grep command 53 4 Perl as a (better) sed command 89 5 Perl as a (better) awk command 121 6 Perl. argument pre-processor for Perl 197 6.7 A Unix- like, OS-portable find command 198 Making the most of find 2perl 198 ✦ Helping non -Unix friends with find 2perl 199 6.8 Summary 200 Directions for further

Ngày đăng: 25/03/2014, 10:27

Từ khóa liên quan

Mục lục

  • brief contents

  • contents

  • foreword

  • preface

  • acknowledgments

  • about this book

    • Audience and organization

      • Part 1: Perl for UNIX and Linux users

      • Part 2: Perl for UNIX and Linux Shell programmers

      • Reference materials

      • Author’s approach

        • Reference value

        • Forewarned is forearmed

        • Entertainment value

        • Essential terminology

        • Typographical conventions

          • Constant width

          • Constant width bold

          • Italics

          • Markup for highlighting and cross-referencing

          • Special characters

          • Shell and Perl comments

          • Displays of commands or code with output

            • Shell command-with-output displays

            • Perl code-with-output displays

Tài liệu cùng người dùng

Tài liệu liên quan