Learning Perl for WIN32

Overview

In this smooth, carefully paced course, leading Perl trainers and a Windows NT practitioner teach you to program in the language that promises to emerge as the scripting language of choice on NT. With a foreword by Larry Wall, the creator of Perl, this book is the "official" guide for both formal (classroom) and informal learning. Based on the "llama book," Learning Perl on Win32 Systems features tips for PC users and new NT-specific examples.

Perl for Win32 is a language for ...

See more details below
Paperback (1 ED)
$25.17
BN.com price
(Save 27%)$34.95 List Price
Other sellers (Paperback)
  • All (49) from $1.99   
  • New (7) from $19.41   
  • Used (42) from $1.99   
Sending request ...

Overview

In this smooth, carefully paced course, leading Perl trainers and a Windows NT practitioner teach you to program in the language that promises to emerge as the scripting language of choice on NT. With a foreword by Larry Wall, the creator of Perl, this book is the "official" guide for both formal (classroom) and informal learning. Based on the "llama book," Learning Perl on Win32 Systems features tips for PC users and new NT-specific examples.

Perl for Win32 is a language for easily manipulating text, files, user and group profiles, performance and event logs, and registry entries, and a distribution is available on the Windows NT Resource Kit. Peer-to-peer technical support is now available on the perl.win32.users mailing list.

The contents include:

  • An introduction to "the Perl way" for Windows users
  • A quick tutorial stroll through Perl in one lesson
  • Systematic, topic-by-topic coverage of Perl's broad capabilities
  • Innumerable, brief code examples
  • Programming exercises for each topic, with fully worked-out answers
  • Access to NT system functions through Perl
  • Database access with Perl
  • CGI programming with Perl

Erik Olson is director of advanced technologies for Axiom Technologies, LC, where he specializes in providing Win32 development solutions. Randal L. Schwartz and Tom Christiansen have also written Programming Perl, co-authored with Larry Wall and published by O'Reilly & Associates.


Similar in concept and execution to the classic "llama" book on which it is based, this excellent Perl 5 tutorial is specific to the Win32 programming environment and Windows NT. This "gentle introduction to Perl" guides you through the syntax and structure of the language itself, clarifies scalar and list data concepts, then explains control structures, basic I/O, notion and use of functions and regular expressions. Walks you through file handles and tests, formats, hashes and additional topics. Discusses file, directory and database manipulation, process management, data transformation and sorting. Explains system information concepts, CGI programming and OLE automation issues. Exercises are available for downloading. This is a very good self-teaching tutorial or class text. The differences between this publication, henceforth to be known as the "gecko" book, and the llama book, known by its formal title as: Learning Perl, are due mostly to the environmental differences between UNIX and Windows NT. Either is very good and both are excellent introductory tutorials, the choice is yours. Read on, there is another new carnivore in the zoo, once you have finished with the "gecko," you can start on Advanced Perl Programming.

Read More Show Less

Editorial Reviews

Doug Nickerson
Perl is an interpreted language that features powerful (and cool-looking) expressions with generally more than one way to manipulate them. With Perl, you can put arrays on both sides of the equals sign, write terse regular expressions using built-in operators, and structure`data with built-in hashes (or associative lists). Perl is Basic meets C meets APL, with objects and an Algol block structure thrown in. Surely serious use of Perl may be hazardous to your health.

Unlike its sister book Programming Perl, Learning Perl on Win32 Systems, by Randal L. Schwartz, Erik Olson, and Tom Christiansen, presents little danger that you will be overwhelmed by Perl's embarrassment of riches.

Learning Perl on Win32 Systems covers the basics of Perl in O'Reilly's trademark well-organized approach, but how much of Win32 is covered? Until about Chapter 10, I was concerned that Win32 might have been added as an afterthought. (O'Reilly's Learning Perl, the ancestor of this book, also included Randal Schwartz as an author.)

Rather than a complete reference to using Perl with Win32, this is Perl with a Win32 slant. Navigating directories, removing files, and getting system status; all are covered with commentary about what you must do to get these to work in Win32.

And because of Perl's UNIX heritage, frequent reference is made to how UNIX and Windows are different. In Perl, calling native Win32 functions, and many other functionalities not supported in the immediate language, is accomplished via extensions. In this book, examples of using some Win32 functions are in the main text, but comprehensive detail about using Win32 extensions is placed in an appendix.

This approach is fine. Win32 need not play much of a role in learning language basics, and the goal is to learn Perl -- not conquer all of its vagaries.

The tutorial in Chapter One is well thought out and the book includes ample exercises (with exercise solutions in an appendix). Covering as it does the basics of the language and providing an orientation for those programming under Windows, Perl beginners will find this book an excellent introduction to Perl.
ercb.com

Booknews
Based on the second edition of Learning Perl, modified to be applicable to Perl programming on Windows NT systems. Provides a "gentle" (from the preface) introduction (rather than a comprehensive guide), touching on most common operations and language idioms found in Perl programs. Each chapter ends with exercises. Annotation c. by Book News, Inc., Portland, Or.
Read More Show Less

Product Details

  • ISBN-13: 9781565923249
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 8/28/1997
  • Series: Perl Series
  • Edition description: 1 ED
  • Edition number: 1
  • Pages: 312
  • Product dimensions: 7.02 (w) x 9.16 (h) x 0.74 (d)

Meet the Author

Erik Olson is a renegade linguist who makes a living developing software for Win32 platforms. Erik is currently the chief technical officer at Axiom Technologies, LC, a software outsourcing shop. Erik delivers developer training, system administration, and program/concept development for a number of large-scale horizontal and vertical applications. Working as a program developer since 1986, Erik has implemented a variety of systems ranging from point-of-sales systems to horizontal PIM products to real-time financial market applications. Although much of his work is done in C++, he has particular interests in Web development and scripting languages. Erik coauthored Learning Perl on Win32 Systems with Tom Christiansen and Randal Schwartz.

Tom Christiansen is a freelance consultant specializing in Perl training and writing. After working for several years for TSR Hobbies (of Dungeons and Dragons fame), he set off for college where he spent a year in Spain and five in America, dabbling in music, linguistics, programming, and some half-dozen different spoken languages. Tom finally escaped UW-Madison with B.A.s in Spanish and computer science and an M.S. in computer science. He then spent five years at Convex as a jack-of-all-trades working on everything from system administration to utility and kernel development, with customer support and training thrown in for good measure. Tom also served two terms on the USENIX Association Board of directors. With over fifteen years' experience in UNIX system administration and programming, Tom presents seminars internationally. Living in the foothills above Boulder, Colorado, surrounded by mule deer, skunks, and the occasional mountain lion and black bear, Tom takes summers off for hiking, hacking, birding, music making, and gaming.

Read More Show Less

Read an Excerpt


Chapter 1: Introduction

In this chapter:

  • History of Perl
  • Purpose of Perl
  • Availability
  • Support
  • Basic Concepts
  • A Stroll Through Perl
  • Exercises

History of Perl

Perl is a language designed for people who need to get things done. Written by the amazing Larry Wall as a kind of glue language to tie together all of the loose ends of everyday computing life, Perl is a tool for leveraging the skills and tools that you already have. Perl has become an indispensable boon to Windows NT webmasters, power users, administrators, and programmers who have discovered how much easier it is to get their work done when Perl is doing some of it for them.

Do you know a little about C? Then you probably already know a lot about Perl. In fact, if you have used any programming or scripting language before, you might be surprised at how familiar Perl looks. Perl is not only an easy language to use, but also makes great use of your existing tools and solutions.

Perl is an easy language, but it's also a rich language, offering lots of functionality right out of the box. You'll be surprised at how much you can do with just a little bit of Perl code. Often, rewriting a small scrap of Perl wizardry requires hundreds of lines of C. Some languages that let you do a lot with a little don't let you do a whole lot. Perl not only lets you do a lot, it lets you do so with minimal effort. And if you run into something that you can't do in Perl, you'll find most likely that Perl will cooperate quite nicely with whatever you do have to do it in.

For many addicts, Perl is more than a language, it's an entire culture. For many folks, Perl was an indispensable part of their UNIX toolkits that they took with them to new environments. As a result, Perl grew, and became even more general and more powerful. What was once just an exceptional text-processing language that bound UNIX programs together has become a widespread language that seems to bind much of the Internet together. Perl is now used to create web pages, read Usenet news, do system administration and systems programming, write network clients and servers, and much more.

The three chief virtues of a Perl programmer (indeed, of any programmer) are sometimes said to be laziness, impatience, and hubris. Although these may seem like undesirable qualities at first blush (just ask your SO), there's more to this than there appears to be.

Laziness is the quality that makes you take great efforts to reduce the overall amount of work that you have to do. Lazy programmers are apt to develop reusable and general solutions that can be used in more than one place, and are more apt to document what they do, so that they don't have to ever waste time or torture their brains figuring it out again.

Impatient programmers get angry whenever they have to do anything that the computer could be doing for them. Hence, they develop programs that anticipate their needs and solve problems for them, so that they can do less (there's that laziness again) while accomplishing more.

Finally, hubris is that quality which makes programmers write programs that they want other people to see (and be able to maintain). Hubris is also a quality that promotes innovation: if you think that you have a better way and you're not afraid to prove it, you're often right.

Odd ideas for a culture, perhaps, but effective ones. Here's another tenet of the Perl way: "There's more than one way to do it." What this means is that Perl programmers are a results-oriented lot. They're likely to applaud any tool that gets the job done, regardless of whether or not the code looks like something they would have written. Another side effect of this tenet that particularly endears itself to Win32 Perl programmers is that Perl is highly portable. Although ready-made scripts that you find on the Net may use existing UNIX tools or UNIX system calls that aren't portable to the Windows environment (this scenario has led Win32 programmers to say, "There's more than one way to do it, and it's a good thing, because most of the ways don't work"), you can nearly always find a way to make them work (and nobody will make fun of you if your solution is perhaps somewhat less than elegant).

True to this philosophy, Perl stands for either Practical Extraction and Report Language or Pathologically Eclectic Rubbish Lister (both derivations are sanctioned by the Perl community). Perl for Win32 sprang into existence when Microsoft commissioned ActiveState Tool Corporation (formerly Hip Communications) to do a port for inclusion in the Windows NT Resource Kit. ActiveState is still improving Perl for Win32, extending it with functionality specific to the Win32 platforms, and incorporating the best and most appropriate new features as they are added to the core Perl distribution.

You'll find that Pert for Win32 uses some of the coolest and most compelling technologies available to Windows programmers including OLE automation, ODBC database connectivity, ActiveX scripting, and much more. The source code for Pert (including Pert for Win32) is freely available and freely redistributable. If you want to extend Pert to provide additional features, or embed the interpreter in your own application, you can easily do so.

You'll also find that the Pert community believes in (and practices) information and code sharing. There is an archive network (called the CPAN, for Comprehensive Pert Archive Network), where you can find thousands of existing Pert programs and code fragments.

In addition to a vast body of high quality pre-written code, Pert excels at rapid application development. Part of this is due to the powerful qualities of language that let you do lots Of work with a few statements-another part is due to the Pert development tools themselves.

Perl is an interpreted language, but it might work a little bit differently from other interpreted languages that you've used. Pert is actually both a compiler and an interpreter, When you invoke the Pert interpreter on a Perl script file, the file is first Compiled and optimized, then efficiently executed. Not only does this allow for efficient runtime execution, it also promotes a quick development cycle, in which you can quickly make changes and rerun your script without going through a long compile and link cycle.

In spite of Perl's relatively free syntax, you can easily develop correct Pert programs. Not only is there a Pert debugger, but the compiler itself will issue informative warnings when you're treading on thin ice. Furthermore, the interpreter doesn't execute unless the program compiles completely. This feature saves You from the common interpreted-language nightmare in which the first half of Your program works and does Something to a file, and then the second half doesn't.

Purpose of Perl

Well, you've made it through the Pert hype. You might be wondering why you'd ever use Perl. This section provides a couple of ideas.

You can use Perl for World Wide Web (www) programming. You've probably heard that Pert has become a sort of lingua franca for the Web (actually, you may have heard that statement for more than one language, but we'll say it again here). Pert cannot only be used as a CGI language (for which there are wonderful modules available), but it can be used as an ISAPI extension (an in-process extension to your web server), or even as an ActiveX scripting language. You can also use Perl to validate HTML syntax, to verify that web hyperlinks are still correct, and to fetch URLs from the Internet.

You can use Perl for many system administration chores. Not only will Perl let you manipulate the Registry, the Event Log, and Windows NT user account information, it's also the best tool going for processing log files of nearly any format.

You can use Perl to drive your favorite word processor or spreadsheet using OLE Automation. You can use the freely available Win32::ODBC module or Active Data Objects (ADO) to access your favorite local or enterprise database.

You can use Perl to retrieve (and filter) your email and Usenet news. You can use Perl to send email, interact with FTP and HTTP servers, and be a client for nearly any other type of Internet server you can dream up.

You can use Perl to process textual or numerical data, to prototype projects, to do quick search and replace functions in text files, to drive the execution of a sequence of commands, and much, much more.

In short, Perl can do zillions of thing to help you do your job faster and get back to doing things that are fun (many of which you can also use Perl to do). And along the way, you might find that the journey itself can be a lot of fun.

Like any language, Perl can be "write only"; it's possible to write programs that are impossible to read. But with proper care, you can avoid this common accusation. Yes, sometimes Perl looks like line noise to the uninitiated, but to the seasoned Perl programmer, it looks like checksummed line noise with a mission in life. If you follow the guidelines of this book, your programs should be easy to read and easy to maintain, but they probably won't win any obfuscated Perl contests....

Read More Show Less

Table of Contents

Foreword to the First Edition of Learning PerlForeword to the Present EditionPrefaceChapter 1: Introduction Chapter 2: Scalar DataChapter 3: Arrays and List DataChapter 4: Control StructuresChapter 5: HashesChapter 6: Basic I/OChapter 7: Regular ExpressionsChapter 8: FunctionsChapter 9: Miscellaneous Control StructuresChapter 10: Filehandles and File TestsChapter 11: FormatsChapter 12: Directory AccessChapter 13: File and Directory ManipulationChapter 14: Process ManagementChapter 15: Other Data TransformationChapter 16: System InformationChapter 17: Database ManipulationChapter 18: CGI ProgrammingChapter 19: OLE AutomationExercise AnswersLibraries and ModulesNetworking ClientsTopics We Didn’t MentionColophon

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)