Essential Perl

Categories:

Recommended

What Is Perl?

Perl is a free, open source programming language created by Larry Wall. Perl aims for adjectives like “practical” and “quick” and not so much words like “structured” or “elegant”. A culture has built up around Perl where people create and give away modules, documentation, sample code, and a thousand other useful things — visit the Comprehensive Perl Archive Network (CPAN), http://www.cpan.org/, or http://www.perl.com/ to see the amazing range of Perl material available.

Perl Niche

Perl is probably best known for text processing — dealing with files, strings, and regular expressions. However, Perl’s quick, informal style makes it attractive for all sorts of little programs. If I need a 23 line program to get some task done, I can write it in Perl and be done in 3 minutes. Perl code is very portable — I frequently move Perl programs back and forth from the Mac to various Unixes and it just works. With Perl, you are not locked in to any particular vendor or operating system. Perl code is also robust; Perl programs can have bugs, but they will not crash randomly like C or C++ programs. On the other hand, in my opinion, Perl’s easy-going style makes it less appealing for large projects where I would rather use Java.

Warning: My Boring Perl Style

Perl is famous for allowing you to write solutions to complex problems with very short, terse phrases of code. There’s something satisfying about reducing a whole computation down to a single line of dense code. However, I never do that. I write Perl code in a boring, straightforward way which tends to spell out what it’s actually doing step by step. The terse style is mentioned briefly in the Terse Perl section. Also, in versions 5 and 6, Perl has accumulated more sophisticated features which are not covered here. We just do simple old Perl code.

Category:

Attribution

Nick Parlante. Essential Perl. http://cslibrary.stanford.edu/108/EssentialPerl.pdf

VP Flipbook Maker

Convert your work to digital flipbook with VP Online Flipbook Maker! You can also create a new one with the tool. Try it now!