Perl 5 Tutorial

Perl 5 Tutorial


Edition: First Edition
No. of Pages: 241
Language: English
Date of release: 31/12/2003

Release Notes | Table of Contents | Errata

Available Formats:
geek.scorpiorising.ca (United Kingdom)
www.sicomm.us (United States)

My grateful thanks go to the owners of the aforementioned mirror(s) for their generosity in providing server resources to help distribute the document.

Comments / Suggestions?


Welcome to the Perl 5 Tutorial. This is a project started by me (Bernard Chan) in 2001 with the objective of creating a high-quality Perl tutorial targeted at beginners. You can download from here the latest, full text version of the Tutorial in PDF format. This tutorial covers the fundamentals of the Perl language that all Perl programmers are supposed to be familiar with. As a Perl programmer with about 3 years of experience, this Tutorial is my contribution to the Perl community as an introductory resource for beginners. Perl is my favourite programming language, yet it is frequently attributed as being messy and cryptic. I hope that, by working through this Tutorial, readers will be able to learn this programming language more easily and enjoy the freedom and power of Perl.

If you find this Tutorial helpful, please help spread the words!


As I outlined in the preface, this Tutorial was written because there were not many online Perl tutorials on the World Wide Web that featured a decent coverage of the Perl language when I learned the Perl language in 2000. Therefore, I eventually decided to spring into action and started my initial draft of the Perl 5 Tutorial in summer 2001, when I had some spare time during the summer holiday before my second year of study commenced. However, there was another reason that I didn't put into the preface. I established my first Web site in 1998, yet I was disappointed to find that the site was stale with very few visitors despite I devoted quite a lot of time maintaining it. I understand for a site to become popular I needed to include additional features that allow my site to stand out from the crowd, and I arrived at the conclusion of providing invaluable information that visitors are likely to be interested in. I decided to put this Tutorial to a test.

Subject to my limited knowledge in Perl, the initial coverage of the Tutorial was restricted to the very basic aspects of the Perl language (i.e. the first four chapters of the First Edition). It was presented in the form of Web pages online, with each chapter displayed as a page of its own.

Having studied a number of Computer Science courses in the university, I acquired more knowledge and I realized I could further enrich the content of the Tutorial by introducing some fundamental Computer Science topics and principles in the text. Therefore, I decided to expand the coverage of the Tutorial and adjusted the objectives accordingly to reflect the escalated goal. In the course of authoring this Tutorial I developed an interest in the area of technical documentation. First, I am rather proficient in English, especially in reading and writing. At least I found myself writing in a more sophisticated manner than most of my peers. I also appeared to have grasped the key to quality technical writing (I plan on writing an article at a later time to summarize the points I learned through experience --- stay tuned). I constantly adjusted the presentation style according to the knowledge level of the readers, and revised the text judiciously so that readers can digest the material more easily. I intended to convert this Tutorial into an ongoing project as an incubator to foster my technical writing skills. If ever I become a professional technical writer one day, I shall quote this Tutorial as a crucial milestone that best demonstrates my abilities.

In early 2002, micheal, as is known on the Spaceports Forum of which he is a member, visited and left a message in my forum that suggested me to prepare a downloadable version. Meanwhile I was trying out LaTeX, a document preparation system that can be used to create Postscript or PDF files. I decided to try to convert the four chapters prepared into LaTeX source format manually. It took me several months to complete, partly because I was not familiar with LaTeX (neither am I, still), yet I was quite impressed with the output when the first PDF version was generated in January 2003. I worked on the LaTeX sources since then. The online HTML version was abandoned and eventually removed from this site in September 2003 when I released my second release candidate of the First Edition.


I appreciate any comments, suggestions or contributions to this Tutorial. Please don't hesitate to reach me through my email feedback form or my feedback forum. Any form of support for the development of the Tutorial is welcome. Here are some examples:

  • words of encouragement. Long-term maintenance of this project requires devotion of a great deal of effort. At certain points in time I intended to give up the project in its entirety. Sincere encouragement is the best spiritual replenishment providing me with some incentives to proceed.
  • error reports or suggestions. This helps me locate and correct occasional errors that appear in the Tutorial. Please make sure you provided enough details, such as the page number and quote the parts that should be corrected in a subsequent release. Creative ideas of any kind or suggestions on topics of interest are also welcome.
  • financial support. As the First Edition approaches completion, publicity of this site has been growing steadily. So is the bandwidth consumption. If this increasing trend continues I shall reach the bandwidth limits of my current Web hosting account in the foreseeable future. I am short of income to sustain any increase in payment for Web hosting accounts in exchange for higher bandwidth limits. Financial support allows me to continue to publish this Tutorial for free. I don't intend to receive any profits from this Tutorial. However, if you have enjoyed reading and have benefited from this Tutorial, you are welcome to make financial contributions of any kind at your preference. Alternatively, if you are in charge of a Web server and have plenty of bandwidth, you may help by hosting the downloadable files for this Tutorial.
  • contributions. If you are an expert Perl programmer, consider to contribute by participating in this project as a co-author. Your expertise in knowledge and extensive experience will be very helpful in preparing more advanced topics and securing the technical accuracy of this publication. Any contribution will be duly accredited. Contributors may decide on the development strategies of this project. Other forms of contributions include, but not limited to, preparation of code samples and diagrams, translations, or conversion of the Tutorial into other formats.
Last Updated on 07/04/2008
Chan Bernard Ki Hong (1999-2004).
Downloads | FAQ | Legal Information | Feedback | Validate This Page