Chapter 11. Introduction to Perl Programming


IN THIS CHAPTER

  • Perl in FreeBSD

  • Fundamentals of Perl Scripting

  • A Simple Perl Script

  • Advanced Perl Techniques

  • Useful Perl Resources

Perl is an interpreted programming language, particularly suited for text processing, that is widely used for such tasks as system administration and CGI scripting for active web content. Its name officially stands for Practical Extraction and Report Language (although several variants exist, some tongue-in-cheek). Perl was written by Larry Wall as a replacement for awk, and has grown into a framework of modules created and maintained by an immense network of independent developers. Wall is still Perl's chief architect and is currently (as of this writing) working on the newly redesigned Perl 6.

It's almost impossible to work in the UNIX world or on the Internet in general today without at least some understanding of the Perl language. Despite many structural inconsistencies and quirks, Perl has managed to become the de facto tool for writing quick but versatile programs for just about any purpose. Like shell scripts, Perl programs don't have to be compiled in order to run, and its free-form syntax-checking and its built-in data typing and memory management eliminate many of the headaches of programming in more traditional compiled languages such as C. Perl can thus be used quite effectively with very little programming expertise.

This chapter covers some of the basics of Perl so that you can take advantage of its strengths without having to know enough about programming to be limited by its weaknesses. The chapter is aimed at users who have had some working experience in FreeBSD already and are familiar with the basics of shell scripting (from Chapter 10, "Shell Programming"); it discusses Perl in just enough detail to provide a useful base for writing simple scripts and CGI programs and understanding the concepts in some of the more complex scripts that currently exist. This foundation in the subject will help you teach yourself further Perl techniques by example, using the Perl-based utilities available in FreeBSD or any prewritten tools you might download.

Note

Many, many large books have been written on the subject of Perl. Its usefulness in today's world is so vast, its presence so ubiquitous, and its structure so complex that even those who can claim mastery of Perl are frequently surprised by hidden quirks or tricks that the language can accomplish. You'll learn more about some excellent Perl books and other resources at the end of this chapter.





FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net