ebook img

Minimal Perl: For UNIX and Linux People PDF

503 Pages·2006·5.707 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Minimal Perl: For UNIX and Linux People

Minimal Perl 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. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. Cherokee Station PO Box 20386 Fax: (609) 877-8256 New York, NY 10021 email: [email protected] ©2007 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Manning Publications Co. Copyeditor: Tiffany Taylor 209 Bruce Park Avenue Typesetters: Denis Dalinnik, Dottie Marsico Greenwich, CT 06830 Cover designer: Leslie Haimes ISBN 1-932394-50-8 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – VHG – 10 09 08 07 06 To Yeshe Dolma Sherpa, whose fortitude, endurance, and many sacrifices made this book possible. To my parents, Gloria Grady Washington and William N. Maher, who indulged my early interests in literature. To my limbic system, with gratitude for all the good times we’ve had together. brief contents Part 1 Minimal Perl: 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 as a (better) find command 178 Part 2 Minimal Perl: for UNIX and Linux Shell Programmers 203 7 Built-in functions 205 8 Scripting techniques 247 9 List variables 295 10 Looping facilities 330 11 Subroutines and variable scoping 362 12 Modules and the CPAN 388 vii contents foreword xvii preface xix acknowledgments xxii about this book xxiii about the cover illustration xxxiv list of tables xxxv Part 1 Minimal Perl: for UNIX and Linux Users 1 1 Introducing Minimal Perl 3 1.1 A visit to Perlistan 3 Sometimes you need a professional guide 5 1.2 Perl can be simple 7 1.3 About Minimal Perl 7 What Minimal Perl isn’t 8 ✦ What Minimal Perl is 8 1.4 Laziness is a virtue 9 1.5 A minimal dose of syntax 10 Terminating statements with semicolons 10 1.6 Writing one-line programs 11 Balancing simplicity and readability 12 Implementing simple filters 12 1.7 Summary 14 2 Perl essentials 16 2.1 Perl’s invocation options 17 One-line programming: -e 18 ✦ Enabling warnings: -w 18 Processing input: -n 19 ✦ Processing input with automatic printing: -p 19 ✦ Processing line-endings: -l 20 ✦ Printing without newlines: printf 21 ✦ Changing the input record separator: -0digits 22 ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.