Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what is perl?

9 views
Skip to first unread message

Mike Schmelzer

unread,
Dec 14, 1989, 6:33:02 PM12/14/89
to
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 === xmj...@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 =======

Gary Benson

unread,
Dec 15, 1989, 7:07:57 PM12/15/89
to
In article <XMJSCHM.89...@mbcrrb.harvard.edu>, xmj...@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 === xmj...@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, i...@tc.fluke.COM

Stephane Payrard

unread,
Dec 17, 1989, 1:14:38 PM12/17/89
to

In article <XMJSCHM.89...@mbcrrb.harvard.edu> xmj...@mbcrrb.harvard.edu (Mike Schmelzer) writes:

It would be nice if someone would explain briefly Perl's
history, utility, capabilities and availablity.
--
=== Mike Schmelzer === xmj...@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).

Tom Christiansen

unread,
Dec 17, 1989, 3:31:43 PM12/17/89
to
>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 tch...@convex.COM
"EMACS belongs in <sys/errno.h>: Editor too big!"

0 new messages