Perl the hard Way
This book is a work in progress. I have some ideas about what will go into the next few chapters, but I am open to suggestions. I am looking for interesting programming projects that highlight some of the moderately advances features of Perl, like inter-process communication, the Perl/tk interface, or one of the infinite number of modules on CPAN. Learning Perl the Hard Way is a free book available under the GNU Free Documentation License. Readers are free to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material.
This book is about a marriage of two compatible yet unlikely partners. Extreme Programming (XP) is a software development methodology that enables users, business people, programmers, and computers to communicate effectively. Perl is a dynamic programming language that lets an XP team embrace the inevitable change caused by effective communication. Perl is the fixer and doer of the pair, and XP is the organizer and facilitator. Together they help you build robust software applications efficiently. Like any good marriage, the partners of Extreme Perl support each other. For example, XP asks business people to write acceptance tests, and Perl lets the business people use their own language and tools for the tests.
If you find this book useful, please contribute to the FSF through Affero. I work full time at the FSF now, and if the FSF receives enough donations via Affero ear-marked for this project, I will be able to contribute time to the project again. This site was created as an early distribution center for Picking Up Perl. Picking Up Perl is a freely redistributable tutorial book on Perl. Currently, Bradley M. Kuhn is the primary author of the work. However, some others have contributed small patches, and lots of others have provided useful constructive criticism. Currently, edition 0.12 of the book is available. Note that this book is still under development. Errors are likely, so read carefully.
Due to his current demanding job, bkuhn hasn't had time to work on the book in over a year. He hopes to get started again eventually, and has started a (currently empty) savannah project for PUP.
Perl is a well-established programming language that has been developed through the time and effort of countless free software programmers into an immensely powerful tool that can be used on pratically every operating system in the world. Perl started out as the "Swiss army knife" of computer languages and was used primarily by system administrators, but over time it's grown into an immensely robust language used by web-developers and programmers worldwide. It's also a great way to learn programming techniques and develop your own style of coding. There's more than one way to do it" is the motto of Perl, but this book aims to take you through them all. We'll take you from installation, through the core language elements - regular expressions, references, modules and the like - and onto basic applied techniques.
Web Client Programming with Perl
A web client is an application that communicates with a web server, using Hypertext Transfer Protocol (HTTP). Hypertext Transfer Protocol is the protocol behind the World Wide Web. With every web transaction, HTTP is invoked. HTTP is behind every request for a web document or graphic, every click of a hypertext link, and every submission of a form. The Web is about distributing information over the Internet, and HTTP is the protocol used to do so. Most web users never think about HTTP, just as most TV viewers don't think about how video images get from the studio to their home. But this book is not for the average web user. This book is for people who want to do something that available web software won't let them do.
Programming on the World Wide Web
The Common Gateway Interface (CGI) emerged as the first way to present dynamically generated information on the World Wide Web. CGI allows the computer to generate Web pages instantly at the user's request rather than being written by someone in advance. And at the time of this writing, it remains the only stable and well-understood method for creating such pages. Java presents problems that have not yet been solved. Other products are currently just in the announcement stage. CGI is fun. You can get a kick out of writing scripts that perform tricks for you, and the users enjoy the spice the scripts add to your Web pages. But CGI has a serious side too: It lets the Internet offer the kind of interactive, user-driven applications that modern computer users have come to expect. CGI opens up an entire class of modern applications to the Web.
Perl for Bioinformatics
GenBank (Genetic Sequence Data Bank) is a rapidly growing international repository of known genetic sequences from a variety of organisms. Its use is central to modern biology and to bioinformatics.This chapter shows you how to write Perl programs to extract information from GenBank files and libraries. Exercises include looking for patterns; creating special libraries; and parsing the flat-file format to extract the DNA, annotation, and features. You will learn how to make a DBM database to create your own rapid-access lookups on selected data in a GenBank library.Perl is a great tool for dealing with GenBank files. It enables you to extract and use any of the detailed data in the sequence and in the annotation, such as in the FEATURES table and elsewhere.
Programming With Perl
CGI programming offers you something amazing: as soon as your script is online, it is immediately available to the entire world. Anyone from almost anywhere can run the application you created on your web server. This may make you excited, but it should also make you scared. Not everyone using the Internet has honest intentions. Crackers may attempt to vandalize your web pages in order to show off to friends. Competitors or investors may try to access internal information about your organization and its products. Not all security issues involve malevolent users. The worldwide availability of your CGI script means that someone may run your script under circumstances you never imagined and certainly never tested. Your web script should not wipe out files because someone happened to enter an apostrophe in a form field, but this is possible, and issues like these also represent security concerns.
C supports both aspects extremely efficiently: You use malloc(3) to allocate memory dynamically and a pointer to refer to dynamically and statically allocated memory. While this is as efficient as it gets, you tend to spend enormous amounts of time dealing with memory management issues, carefully setting up and modifying complex interrelationships between data, and then debugging fatal errors resulting from "dangling pointers" (pointers referring to pieces of memory that have been freed or are no longer in scope). The program may be efficient; the programmer isn't. Perl supports both concepts, and quite well, too. It allows you to create anonygmous data structures, and supports a fundamental data type called a "reference," loosely equivalent to a C pointer. Just as C pointers can point to data as well as procedures, Perl's references can refer to conventional data types (scalars, arrays, and hashes) and other entities such as subroutines, type globs, and filehandles. Unlike C, they don't let you peek and poke at raw memory locations.
Perl Simple Chapters
One of the books I've used most often recently is Advanced Perl Programming. I've found myself writing code, remembering that this book explained how to do something, and pulling it off of the shelf to browse. When putting together the "Related Articles" code a couple of months ago, I ran into a problem where I had too much useless information. I needed to extract and summarize only the useful information. This book has a whole chapter on language processing with Perl and, sure enough, a couple of the examples in there did just what I needed to do.
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: April 1, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles