Path: utzoo!attcan!uunet!mailrus!cornell!uw-beaver!fluke!inc From: inc@tc.fluke.COM (Gary Benson) Newsgroups: comp.lang.perl Subject: Re: What is perl? Summary: An excerpt from the man page . Message-ID: <1990Mar25.074126.12030@tc.fluke.COM> Date: 25 Mar 90 07:41:26 GMT References: <458@memqa.uucp> <745@idsssd.UUCP> Organization: John Fluke Mfg. Co., Inc., Everett, WA Lines: 108 In article <745@idsssd.UUCP>, bruce@idsssd.UUCP (Bruce T. Harvey) writes: # In article <458@memqa.uucp>, qfhca81@memqa.uucp writes: ## ## Could someone email me a desription of the perl language. I've never ## heard of it before bringing up this newsgroup. # # Absolutely! Me too! What is perl, and why does the world of usenet seem to # be switching over to this language? # # I'd love to know, and so would the other programmers here who've never heard # of it. Is it a BSD-ism? SUN-ism? OTHER-ism? I realize that e-mail was requested, but it seems that there is enough interest to justify a posting. I did this once before, and I am beginning to think that perhaps this should be posted monthly for a while. The following is an excerpt from the on-line manual page for perl: NAME perl - Practical Extraction and Report Language SYNOPSIS perl [options] filename args DESCRIPTION Perl is an interpreted language optimized for scanning arbi- trary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, effi- cient, complete) rather than beautiful (tiny, elegant, minimal). It combines (in the author's opinion, anyway) some of the best features of C, sed, awk, and sh, so people familiar with those languages should have little difficulty with it. (Language historians will also note some vestiges of csh, Pascal, and even BASIC-PLUS.) Expression syntax corresponds quite closely to C expression syntax. Unlike most Unix utilities, perl does not arbitrarily limit the size of your data--if you've got the memory, perl can slurp in your whole file as a single string. Recursion is of unlimited depth. And the hash tables used by associative arrays grow as necessary to prevent degraded performance. Perl uses sophisticated pattern matching techniques to scan large amounts of data very quickly. Although optimized for scanning text, perl can also deal with binary data, and can make dbm files look like associative arrays (where dbm is available). Setuid perl scripts are safer than C programs through a dataflow tracing mechanism which prevents many stupid security holes. If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their capa- bilities or must run a little faster, and you don't want to write the silly thing in C, then perl may be for you. There are also translators to turn your sed and awk scripts into perl scripts. OK, enough hype. Upon startup, perl looks for your script in one of the fol- lowing places: 1. Specified line by line via -e switches on the command line. 2. Contained in the file specified by the first filename on the command line. (Note that systems supporting the #! notation invoke interpreters this way.) 3. Passed in implicitly via standard input. This only works if there are no filename arguments--to pass argu- ments to a stdin script you must explicitly specify a - for the script name. After locating your script, perl compiles it to an internal form. If the script is syntactically correct, it is executed. Printed 2/4/90 Release 3.0 Patchlevel 8 1 This manual page comes from our "old" version of perl - patches 9 through 15 appeared in a flurry here about 3 weeks ago, and they are not yet installed here. Apparently Patch 16 is in preparation. The program was designed and created by Larry Wall, of rn fame, and it is distributed under the auspices of the FSF. As a budding programmer, I find perl to be a really "friendly" language to learn for many reasons. My earlier shell scripts and experience with grep, sed, and awk are serving me well. I am also studying C, and many of the concepts I am learning in that endeavor transport well to perl. As a novice myself, I do not yet know all the reasons perl is taking off as it is; but for myself, the three major pluses have been the helpful explanations given for error conditions, the ease of using associative arrays, and the ability to read in a whole file and spit parts of it back out (rearranged, sorted, and otherwise beautified) in several different directions. Oh ! I just thought of another reason for perl's increasing popularity. This newsgroup! I posted a set of novice questions a few months back, and got an overwhelming response. There are LOTS of people using perl who just seem interested in helping each other along. I've never seen anything like it on USENET. The fact that Larry regularly writes here and actively supports his program goes a long way to helping people understand his reasoning, and therefore to learning his exciting new language. -- Gary Benson -=[ S M I L E R ]=- -_-_-_-inc@fluke.tc.com_-_-_-_-_-_-_-_-_- And out of olde bokes, in good feyth, cometh al this newe science. -Geoffrey Chaucer