xmjschm@mbcrrb.harvard.edu (Mike Schmelzer) (12/15/89)
I think the subject line says it all. It would be nice if someone would explain briefly Perl's history, utility, capabilities and availablity. -- === Mike Schmelzer === xmjschm@mbcrr.harvard.edu ====== 617-732-3746 ======= "A matter of opinion derives weight from the name which is attached to it; but a chain of reasoning is equally conclusive, whoever may be the author." ================================================== - Charles Babbage =======
inc@tc.fluke.COM (Gary Benson) (12/16/89)
In article <XMJSCHM.89Dec14183302@mbcrrb.harvard.edu>, xmjschm@mbcrrb.harvard.edu (Mike Schmelzer) writes: > I think the subject line says it all. > > It would be nice if someone would explain briefly Perl's > history, utility, capabilities and availablity. > -- > === Mike Schmelzer === xmjschm@mbcrr.harvard.edu ====== 617-732-3746 ======= I'm not sure if this answers all your questions, but it at least answers the subject line, "What is PERL?" I took it from the online manual page here at Fluke. Perhaps others can fill in other details for you. PERL(PUBLIC) UNIX Programmer's Manual PERL(PUBLIC) 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 exe- cuted. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- The entire manual page is quite lengthy, so I will not duplicate it here. This ought ought to be enough to pique your interest, though! Here in Fluke's Tech Pubs group, we use a PERL script for scanning "clear text" files and inserting appropriate typesetting codes for sending to other software for generating typeset and/or fully made-up pages. The original script was written by a programmer, and was commented well enough (and structured in tidy modules) such that I, with hardly any real programming training or experience, can modify it as we find new requirements. There are peopel here who have created new modules for me by first writing the application in awk, then translating. Sorry, I do not know the name of the awk-to-PERL translator. Good luck; I hope this has helped answer some of the questions about what PERL is. Gary Benson, inc@tc.fluke.COM
stef@zweig.sun.com (Stephane Payrard) (12/18/89)
In article <XMJSCHM.89Dec14183302@mbcrrb.harvard.edu> xmjschm@mbcrrb.harvard.edu (Mike Schmelzer) writes:
It would be nice if someone would explain briefly Perl's
history, utility, capabilities and availablity.
--
=== Mike Schmelzer === xmjschm@mbcrr.harvard.edu ====== 617-732-3746 =======
"A matter of opinion derives weight from the name which is attached to it;
but a chain of reasoning is equally conclusive, whoever may be the author."
================================================== - Charles Babbage =======
Originally, Perl was a report generator langage, something comparable
to nawk. I have seen it for the first time one or two year ago; but as
promising it sounded, it was too buggy and I decided not to use it. A few
weeks ago, I have given it a second chance and now I am very
enthousiastic about the language and its implementation.
Perl is now a full fledged language which provides in one Unix Process
the functionalities which are usually provided by complex (and slow)
combinations (via multiple process and pipes) of sh, awk (ou nawk) and
sed, or by a C program.
Perl is now hooked to the OS: the language provide access
to system calls as built-in feature; if you use system-calls for which
Perl provide no wrapper, you can use as well syscall() combined with pack.
There is also a Perl debugger (written in Perl).
Perl has both the advantage of an interpreted language (flexibility,
extensibility, source code always available) and of a compiled one
(speed) because it compiles code in an internal format before
executing it. It runs on many hardware platform.
I think it is somewhat a heavy investment to learn Perl. But, once you
have done it, you can do so many things with it so that you have no
more to cope with many of the hundreds of weird Unix utilities. I
think that the time usually spent to learn all the UNIX text/file
manipulation micro-tools (paste, cut, xargs, head, wc, test, basename,
split, uniq...) and the glue to combine them (various shells) is more
efficiently used learning Perl. Nevertheless, a previous knowledge of
the usual Unix stuff (c, awk, sh and pattern matching) gives you a
faster handle on the language. One reason is that tutorial material is
not yet released and that the reference manual assumes from the reader
a good knowledge of Unix environement.
I think Perl is great for almost every system-administration task, for
very small programs or rapid-prototyping. But it is not excluded that
Perl is useful to write medium-size programs (I am in fact heading in
that way!!!)
Some bunch of good administrative utilities is part of the toolkit.
They provide a good way to learn by examples the language.
I think (I am not sure) that Perl is not part of the gnu distribution.
But it is distributed under the conditions of the gnu distribution.
If I understand well, it means you cannot include Perl or use source
of Perl interpreter as part of a commercial release. This is quite
limitative for much of us programmers working for private/greedy ;-)
companies (For that particular subject, please direct followup to
gnu.mic.discuss or dev/null)
Whatever, Perl is representative of the quality of all this gnu copyleft
stuff. with the following restrictions : the language is not yet very
stable and there is still some nasty bugs (not blocking ones in
general).
I think Larry Wall (the creator and implementor of Perl) is
stabilizing the language and is active fixing the remaining bugs.
you can find the last version of Perl by anonymous ftp to
jpl-devvax.jpl.nasa.gov (128.149.8.43) and get patches regularly from
the same server. If you want to keep you up to date, or are blocked by a
problem, you will also need to get the prgram 'patch' to apply this
patches. Larry Wall seems very receptive to any feedback and seems to
correct the reported problems very quickly.
There is also a mail list and posted digests for which you will find
information in previous posting to this news-group.
I hope that my laius has answered your questions ... and wonders of
people who are discovering this new and promising news-group.
Sorry for my lousy english (yet another not so natural language I try
to master).
tchrist@convex.COM (Tom Christiansen) (12/18/89)
>I think (I am not sure) that Perl is not part of the gnu distribution. >But it is distributed under the conditions of the gnu distribution. >If I understand well, it means you cannot include Perl or use source >of Perl interpreter as part of a commercial release. This is quite >limitative for much of us programmers working for private/greedy ;-) >companies (For that particular subject, please direct followup to >gnu.mic.discuss or dev/null) Well, that's not quite true as far I understand these matters. You can include copylefted code as part of a commercial release, providing that you not charge extra for it above and beyond your standard release (save for a maintenance warranty) and that you make the source available. If this means using just some copylefted code in a new work, then the whole new work falls under the copyleft. I'd like to see manufacturers include perl on their standard distribution tapes, and I see no reason that this should violate the copyleft. I can't really see someone using just part of the perl source in a new work anyway. I doubt Larry would have put perl under the copyleft if he thought doing so would limit its distribution, and I don't think it does. --tom Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "EMACS belongs in <sys/errno.h>: Editor too big!"
qfhca81@memqa.uucp (03/20/90)
Could someone email me a desription of the perl language. I've never heard of it before bringing up this newsgroup. Henry Melton ...!cs.utexas.edu!execu!sequoia!memqa!qfhca81
bruce@idsssd.UUCP (Bruce T. Harvey) (03/23/90)
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? Many thanks. Bruce Harvey bruce@idsssd.UUCP -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Bruce T. Harvey {B-}> | bruce@idsssd.UUCP <==> ...!sarin!wb3ffv!idsssd!bruce System Administrator | Convergent Route Dist. Sys. -- 222 Schilling Circle (301) 329-1100 | Hunt Valley, MD 21031
inc@tc.fluke.COM (Gary Benson) (03/25/90)
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
inc@tc.fluke.COM (Gary Benson) (03/26/90)
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? As a budding programmer and novice perl user myself, I would like to respond. This question is asked regularly, so I wonder if a monthly posting might be in order. I realize that the original request for was for emailed information, but there seems to be enough interest to call for a posting. Those who have perl and can access the online documentation should just skip this article. The following extract is the first page of the on-line perl manual as it exists here at Fluke. Note that we are not up-to-date with the current patch level, but this first page is generic enough that not much (if anything) will change. NAME perl - Practical Extraction and Report Language SYNOPSIS perl [options] filename args DESCRIPTION Perl is an interpreted language optimized for scanning arbitrary 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, efficient, 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 capabilities 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 following 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 _-_-_-_-_-_-_-_-_-_-_-_-_end of manual page extract-_-_-_-_-_-_-_-_-_-_-_ This is the first page - the entire online manual is 65 printed pages; I don't think there is much value in posting the entire thing. Perl was designed and created by Larry Wall, and is distributed under the auspices of the FSF. The current version is Release 3 Patchlevel 15, with a Patch 16 apparently in the works. As a newcomer to programming, I cannot answer fully or accurately the question about why perl is gaining popularity so rapidly, but in my own experience, four features have been of enormous benefit: 1. Error messages are clear and accurate, usually even giving the exact line number where the problem exists (or started!). A built-in debugger lets you single-step through a program examining your variables and arrays as they get built. For a beginner, these features have enhanced my learning significantly. 2. Everything in the language seems self-consistent, but at the same time similar to other programs (like sed and awk) that perform the same or similar functions. There is even a program that converts awk and sed scripts to perl to aid people to make the transition! 3. Associative arrays are easy to work with, even for someone like me who did not know what one was two months ago. 4. This newsgroup! A few months ago, I posted a set of novice questions, and the response was overwhelming. One good reason for the success of the language is the way this group runs itself. It seems that even the rankest amateur (like me) is free to post his questions without fear of ridicule, and in fact, and even the most macho super gurus are not too busy to help answer them. The fact that Larry Wall writes regularly here is a definite benefit, and his active involvement in supporting his program probably has a lot to do with the growth of his exciting new language. I hope this partly answers your questions - and I hope that some of the more knowledgeable types will let us know their reasons for liking perl. I know that my novice perspective has a certain kind of value, but the answers of the more high-powered will probably be much more interesting. -- Gary Benson -=[ S M I L E R ]=- -_-_-_-inc@fluke.tc.com_-_-_-_-_-_-_-_-_- To simplify means to eliminate the unnecessary so that the necessary may speak. -Hans Hoffman
wscott@ecn.purdue.edu (Wayne H Scott) (10/27/90)
I get asked that question all the time. The problem that I never seem to be able to give an answer that does it justice. After I tell them something like,... it is a scripting language that combines the power and usefulness of sed, awk, shells, C, and several other utilitys... they act like it is a complicated mess that is not worth learning. I thought if I had a short utility written in perl that is useful, takes advantage of perl's features, and simply done, I could convince people. Does anyone have such a script? (Or have a just demostrated that I can't explain anything to anybody :) -- _______________________________________________________________________________ Wayne Scott | INTERNET: wscott@ecn.purdue.edu Electrical Engineering | BITNET: wscott%ecn.purdue.edu@purccvm Purdue University | UUCP: {purdue, pur-ee}!ecn.purdue.edu!wscott
piet@cs.ruu.nl (Piet van Oostrum) (10/29/90)
>>>>> In article <1990Oct27.000801.5853@ecn.purdue.edu>, wscott@ecn.purdue.edu (Wayne H Scott) (WHS) writes: WHS> I thought if I had a short utility written in perl that is useful, WHS> takes advantage of perl's features, and simply done, I could WHS> convince people. I think the following script meets your requirements: (I call it rename) You can use it for things like renaming all *.p files to *.pas ------------------------------------------------------------------------ #! /usr/bin/perl do "getopts.pl" || die "Can't include getopts.pl"; do Getopts('cdhilmnqrsC'); if ($opt_h) { print <<END; Usage: rename [-cCdilmnqrs] expr file ... expr: valid perl expression that modifies $_ file: zero or more filenames. rename applies expr to each of the file names and renames the files to the new names (if the name has changed). If no filenames are given filenames are read form STDIN. Options: -d or -n print what would happen but do not execute -q (quiet) do not print what happens -i (interactive) ask for confirmation for each file (y => yes; n => no; q => quit; a => all) -m execute a "mv" for each change rather than the rename syscall useful for moving across file systems or to a directory -c copy rather than rename (using "cp") -C remote copy using "rcp" -r with -m, -c or -C, gives -r option to the mv/cp command -l link rather than rename -s make symbolic links Generally, the safer options take precedence over the less safe ones. END exit; } die "Usage: rename [-cCdilmnqrs] s/x/y/ file ...\n rename -h for help\n" unless @ARGV; $expr = shift; $opt_d += $opt_n; $opt_q = 0 if $opt_i || $opt_d; $rflag = $opt_r ? " -r " : " "; $args = @ARGV; while (defined ($_ = $args ? shift(ARGV) : <STDIN>)) { chop unless $args; $old = $_; eval $expr; if ($@) { $_ = $@; s/file.*tokens//; die "$_\n"; } $eol = $opt_i > $opt_d ? "? " : "\n"; $new = $_; if ($old ne $new) { print "$old -> $new$eol" unless $opt_q; unless ($opt_d || $opt_i && ! &confirm) { if ($opt_s) { $res = symlink ($old, $new); } elsif ($opt_l) { $res = link ($old, $new); } elsif ($opt_C) { $res = ! system "rcp$rflag$old $new"; } elsif ($opt_c) { $res = ! system "cp$rflag$old $new"; } elsif ($opt_m) { $res = ! system "mv$rflag$old $new"; } else { $res = rename ($old, $new); } warn "error on $new\n" unless $res; } } } sub confirm { # ask for confirmation ($ans = <STDIN>) =~ s/ *//; exit if ($ans =~ /^q/i); $opt_i = 0 if ($ans =~ /^a/i); return ($ans =~ /^[ay]/i); } ------------------------------------------------------------------------ -- Piet* van Oostrum, Dept of Computer Science, Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet Telefax: +31 30 513791 Internet: piet@cs.ruu.nl (*`Pete')
wengland@stephsf.stephsf.com (Bill England) (10/30/90)
In article <1990Oct27.000801.5853@ecn.purdue.edu> wscott@ecn.purdue.edu (Wayne H Scott) writes: > >I get asked that question all the time. The problem that I never seem to >be able to give an answer that does it justice. After I tell them >something like,... it is a scripting language that combines the power >and usefulness of sed, awk, shells, C, and several other utilitys... >they act like it is a complicated mess that is not worth learning. > [...] >_______________________________________________________________________________ >Wayne Scott | INTERNET: wscott@ecn.purdue.edu The problem might be trying to explain Perl in Unix terms to non Unix users. For instance if talking to Unisys users Perl could be explained as a very good WFL language but, without the bugs and with more power/control. When explaining Perl to IBM'ers tell them that the same thing execpt substitute JCL for WFL. DOS users of course are used to thinking about .bat files. I believe that Vax users use "at" files for job execution. ( I Could be wrong here, its been quite a while since I touched a Vax or PDP.) Mentioning sed, awk, sh, C, etc. can confuse users and MIS managers who have never programmed under Unix. When explaining Perl to new Unix users I let them know what Perl will do for them and make sure that they are able use some system administration programs written in Perl the same day that perl is installed. Another thought I have had, is to refer to Perl less as a scripting language and more as a programming language. Calling an elaborate piece of Perl software a 'script' does not seem to do justice to it. +-------- | Bill England | wengland@stephsf.COM | * * H -> He +24Mev * * * ... Oooo, we're having so much fun making itty bitty suns * * *
rahard@eeserv.ee.umanitoba.ca (Budi Rahardjo) (10/31/90)
How about : Perl is a poor-man "C compiler" ... (I introduced perl to some MS-DOS users, and they were excited since a good C compiler costs $$, not good for students with limitted $$) -- budi -- Budi Rahardjo <rahardj@ccu.umanitoba.ca> <rahard@ee.umanitoba.ca> <rahard@budi.ee.umanitoba.ca> Electrical Engineering - University of Manitoba - Canada