home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Information / Languages / Perl / perl-faq⁄part1 < prev    next >
Encoding:
Internet Message Format  |  1994-12-03  |  42.7 KB  |  [TEXT/R*ch]

  1. Path: bloom-beacon.mit.edu!senator-bedfellow.mit.edu!faqserv
  2. From: spp@vx.com
  3. Newsgroups: comp.lang.perl,comp.answers,news.answers
  4. Subject: comp.lang.perl FAQ 1/5 - Availability
  5. Supersedes: <perl-faq/part1_784894001@rtfm.mit.edu>
  6. Followup-To: poster
  7. Date: 30 Nov 1994 09:40:44 GMT
  8. Organization: none
  9. Lines: 906
  10. Approved: news-answers-request@MIT.EDU
  11. Distribution: world
  12. Message-ID: <perl-faq/part1_786188328@rtfm.mit.edu>
  13. References: <perl-faq/part0_786188328@rtfm.mit.edu>
  14. NNTP-Posting-Host: bloom-picayune.mit.edu
  15. X-Last-Updated: 1994/11/14
  16. Originator: faqserv@bloom-picayune.MIT.EDU
  17. Xref: bloom-beacon.mit.edu comp.lang.perl:27004 comp.answers:8611 news.answers:30225
  18.  
  19. Archive-name: perl-faq/part1
  20. Version: $Id: part1,v 2.3 1994/11/07 18:05:23 spp Exp spp $
  21. Posting-Frequency: bi-weekly
  22.  
  23. This posting contains answers to general information and availability
  24. questions.  The following questions are answered in this posting: 
  25.  
  26.  
  27. 1.1) What is Perl?
  28.     
  29.     Perl is a compiled scripting language written by Larry Wall*.
  30.  
  31.     Here's the beginning of the description from the perl(1) man page:
  32.  
  33.     Perl is an interpreted language optimized for scanning arbi-
  34.     trary  text  files,  extracting  information from those text
  35.     files, and printing reports based on that information.  It's
  36.     also  a good language for many system management tasks.  The
  37.     language is intended to be practical  (easy  to  use,  effi-
  38.     cient,  complete)  rather  than  beautiful  (tiny,  elegant,
  39.     minimal).  It combines (in  the  author's  opinion,  anyway)
  40.     some  of the best features of C, sed, awk, and sh, so people
  41.     familiar with those languages should have little  difficulty
  42.     with  it.  (Language historians will also note some vestiges
  43.     of csh, Pascal,  and  even  BASIC-PLUS.)  Expression  syntax
  44.     corresponds  quite  closely  to C expression syntax.  Unlike
  45.         most Unix utilities, perl does  not  arbitrarily  limit  the
  46.     size  of your data--if you've got the memory, perl can slurp
  47.         in your whole file as a  single  string.   Recursion  is  of
  48.     unlimited  depth.   And  the hash tables used by associative
  49.         arrays grow as necessary to  prevent  degraded  performance.
  50.     Perl  uses sophisticated pattern matching techniques to scan
  51.         large amounts of data very quickly.  Although optimized  for
  52.     scanning  text, perl can also deal with binary data, and can
  53.         make dbm files look like associative arrays  (where  dbm  is
  54.     available).   Setuid  perl scripts are safer than C programs
  55.         through a dataflow tracing  mechanism  which  prevents  many
  56.     stupid  security  holes.   If  you have a problem that would
  57.         ordinarily use sed or awk or sh, but it exceeds their  capa-
  58.     bilities  or must run a little faster, and you don't want to
  59.         write the silly thing in C, then perl may be for you.  There
  60.     are  also  translators to turn your sed and awk scripts into
  61.         perl scripts.  OK, enough hype.
  62.  
  63.  
  64. 1.2) What are perl4 and perl5, are there any differences?
  65.  
  66.     Perl4 and perl5 are different versions of the language.  Perl4 was the
  67.     previous release, and perl5 is "Perl: The Next Generation."
  68.     Perl5 is, essentially, a complete rewrite of the perl source code
  69.     from the ground up.  It has been modularized, object oriented, 
  70.     tweaked, trimmed, and optimized until it almost doesn't look like
  71.     the old code.  However, the interface is mostly the same, and
  72.     compatibility with previous releases is very high.
  73.  
  74.  
  75. 1.3) What features does perl5 provide over perl4?
  76.  
  77.     If you get the newest source (from any of the main FTP sites), you will
  78.     find a directory full of man pages (possibly to be installed as section
  79.     1p and 3pm) that discuss the differences, new features, old
  80.     incompatibilies and much more.  Here, however, are some highlights as
  81.     to the new feature and old incompatibilites.
  82.  
  83.     * Enhanced Usability:  Perl code can now be written in a much more
  84.     legible style.  Regular expressions have been enhanced to allow
  85.     minimal matches, conditionals, and much more.  Cryptic variable
  86.     names (although still supported) have been aliased to new
  87.         nmemonics, using the "English" module, allowing old scripts to run
  88.         and new scripts to be readable.  Error messages and optional
  89.         warnings are more informative and will catch many common mistakes.
  90.         See the perldiag(1) man page, which contains pithy prose from Larry
  91.         Wall* on each and every possible muttering perl might spout at you.
  92.     * Simplified Grammar:  The new yacc grammar is one half the size of
  93.     the old one.  Many of the arbitrary grammer rules have been
  94.     regularized.  The number of reserved words has been cut by 2/3.
  95.     * Lexical Scoping:  Perl variables may now be declared within a
  96.     lexical scope, similar to C's "auto" variables.  This is a
  97.     great improvement on efficiency and contributes to better
  98.     privacy.  See the my() entry in perlfunc(1).
  99.     * Arbitrarily nested data structures:  Full fledged multidimensional
  100.     arrays.  Any scalar value, including an array element, may now
  101.     contain a reference to any other variable or subroutine.
  102.     Easily created anonymous variables and subroutines.  See
  103.         perlref(1).
  104.     * Modularity and Reusability:  The Perl library is now defined in
  105.     terms of modules which can be easily shared among various
  106.     packages.  Packages can import any or all of a module's
  107.     published interface.  See perlmod(1), perlsub(1), and
  108.         Exporter(3pm). 
  109.     * Object-oriented programming:  A package can function as a class.
  110.     Dynamic multiple inheritance and virtual methods are supported
  111.     in a straight-forward manner with little new syntax.  Filehandles
  112.     are now treated as objects.  See perlobj(1), perlmod(1), and
  113.         FileHandle(3pm). 
  114.     * Embeddible and Extensible:  Perl can be easily embedded in C/C++
  115.     approlications, and can either call or be called by your
  116.     routines through a documented interface.  The XS preprocessor
  117.     is provided to make it easy to glue your C/C++ routines into
  118.     Perl.  Dynamic loading of modules is supported.  See perlapi(1),
  119.         perlcall(1), and DynaLoader(3pm).
  120.     * POSIX compliant:  A major new module is the POSIX module, which
  121.     provides access to all available POSIX routines and definitions.
  122.         Seee POSIX(3pm).
  123.     * Package constructors and destructors:  The new BEGIN and END blocks
  124.         provide means to capture control as a package is being compiled and
  125.         after the program exits.  As a degenerate case, they work just like
  126.         awk's BEGIN and END when you use the -p or -n switches.  See
  127.         perlmod(1). 
  128.     * Multiple simultaneous DBM implementations:  A perl program now has
  129.         access to DBM, NDBM, SDBM, GDBM and Berkeley DB files in the same
  130.         script.  The dbmopen interface has been generalized to allow any
  131.         variable to be tied to an object class which defines its access
  132.         methods.  tie/untie now preferable to dbmopen/dbmclose.  See the
  133.         tie() entry in perlfunc(1) and the DB_File(3pm) man pages.
  134.     * Subroutine definitions may now be autoloaded:  The AUTOLOAD mechanism
  135.         allows any arbitrary semantics to undefined subroutine calls.  See
  136.         the section on Autoloading in the perlsub(1) manpage.
  137.     * Regular Expression Enhancements:  Qualifiers may be followed by a "?"
  138.     to signify that they should be non-greedy.  A "?" directly after
  139.     an opening paren indicates non backreference grouping and the next
  140.     character determines the purpose of the match (?:a|b|c) will match
  141.     any of a b or c without producing a backreference, (?=stuff) does
  142.     a non-eating look ahead to assure that the next thing is stuff, 
  143.     (?!nonsense) looks ahead to assure that the next thing must not
  144.     be "nonsense".  Embedded whitespace and comments for readability.  
  145.     A consistent extensibility mechanism has been added that is 
  146.     upwardly compatible with all old regexps.  Variables may now be 
  147.     interpoled literally into a pattern with \Q or the quotemeta 
  148.     fuction, which works like \U but backwhacks non-alphanumerics.  
  149.     New m and s "flags" for pattern matching force multi- or 
  150.     single-line matching.  The "s" makes "." match "\n".  \A and
  151.     \Z anchor matches to the beginning and end of a string and ignore
  152.     multiline semantics.  \G matches where the previous m//g or s///g
  153.     left off.
  154.     * The -w (warnings) switch is much more informative.
  155.     * References and Objects (see t/op/ref.t) for examples.
  156.     * => is a synonum for comma and helps group paired arguments, such
  157.     as initializers for associative arrays and named arguments to
  158.     subroutines.
  159.     * All functions, even predeclared subroutines, are treated as list
  160.         operators or unary operators.  Parens are optional. 
  161.     * Flattened interpreter:  Compare perl4's eval.c with perl5's pp.c.
  162.     Compare perl4's 900 line interpreter look with perl5's one line.
  163.     * eval is now treated like a subroutine call, meaning (among other
  164.     things) you can return from it.
  165.     * format value lists may be spread over multiple lines with a do {}
  166.     block.
  167.     * flags on the #! line are interpreted even if the script wasn't
  168.     invoked directly.
  169.     * ?: is now an lvalue.
  170.     * list context now propogates to the right side of && and ||, and
  171.     as the 2nd and 3rd arguments of ?:
  172.     * preferred package delimeter now :: rather than '.
  173.     * new "and" and "or" operators, like && and || but with a lower
  174.     precedence than comma, so they work better with list operators.
  175.     * New functions abs(), chr(), uc(), ucfirst(), lc(), and lcfirst()
  176.     * require(number) checks to see that the version is at least that
  177.     version
  178.     * qw//, which is equivalent to split(' ', q//)
  179.     * assignment of a reference to a glob replaces the single element
  180.     of the glob corresponding to the reference type:
  181.         *foo = \$bar, * foo = \&bletch;
  182.     * filehandle methods are supported:
  183.     output_autoflush STDOUT 1;
  184.     * Autoload stubs can now call the replacement subroutine with
  185.     goto &realsub.
  186.     * Subroutines can be defined lazily in any package by declaring
  187.     an AUTOLOAD routine, which will be called if a non-existant
  188.     subroutine is called in that package.
  189.     * "use" and "no" subsume many feautres.  "use Module LIST" is
  190.     short for "BEGIN { require Module; import Module LIST }"
  191.     "no" is identical, except that it calls "unimport" instead.
  192.     "use integer" and variations of "use strict [vars,refs,subs]"
  193.     were implemented through new modules.
  194.  
  195. (Thanks to Tom Christiansen* for this section)
  196.  
  197.  
  198. 1.4) Where can I get docs on perl5?
  199.   
  200.     The complete perl documentation is available with the Perl
  201.     distribution, or can be accessed from the following sites.
  202.     Note that the PerlDoc ps file is 240 pages long!! 
  203.   
  204.         http://www.metronet.com/0/perlinfo/perl5/manual/perl.html
  205.         ftp://ftp.uu.net/languages/perl/PerlDoc.ps.gz
  206.         ftp://prep.ai.mit.edu/pub/gnu/PerlDoc.ps.gz
  207.         ftp://ftp.cbi.tamucc.edu/pub/duff/Perl/PerlDoc.ps.gz
  208.         ftp://www.metronet.com/pub/perlinfo/perl5/manual/PerlDoc.ps.gz
  209.         http://web.nexor.co.uk/perl/perl.html                    (Europe)
  210.         ftp://ftp.zrz.tu-berlin.de/pub/unix/perl/PerlDoc.ps.gz  (Europe)
  211.         ftp://ftp.cs.ruu.nl/pub/PERL/perl5.0/PerlDoc.ps.gz      (Europe)
  212.         ftp://sungear.mame.mu.oz.au/pub/perl/doc/PerlDoc.ps.gz  (Oz)
  213.   
  214.  
  215. 1.5) Will perl5 break my perl4 scripts?
  216.   
  217.     In general, no.  However, certain bad old practices have become highly
  218.     frowned upon.  The following are the most important of the known
  219.     incompatibilies between perl4 and perl5.  See perltrap(1) for more 
  220.     details.
  221.   
  222.     * "@" ***ALWAYS*** interpolate in double quoted strings.  Non-array
  223.     "@"s must be escaped: 
  224.         Mail("foo@bar.com") needs to be
  225.         Mail("foo\@bar.com"); 
  226.     The compiler catches this.
  227.     * "open FILE || die" needs to be "open(FILE) || die".  The compiler
  228.       forgives you for this, but won't stop complaining until you fix it.
  229.     * Barewords are no longer (necessarily) strings: they will actually
  230.       call the function (if it existed when that code was compiled)
  231.       instead of returning a string of that value.  Check your 
  232.       signal handlers.  The 'use strict subs' pragma (see strict(3pm))
  233.       will help you with this.
  234.     * "shift @x + 20" needs to be "shift(@x) + 20" because of precedence,
  235.       and likewise "$y = scalar keys %foo + 30" needs to be instead 
  236.       "$y = scalar keys(%foo) + 30".
  237.     * The internal symbol table is called %{PACKAGE::} for any given 
  238.       package.  It used to be %{_PACKAGE}.
  239.     * You may no longer (attempt to) write to read-only variables, like $1,
  240.       or assign to a substr() past the end of a string.
  241.     * Various deprecated practices elicit warning messages.
  242.   
  243.  
  244. 1.6) When will Perl stabilize?
  245.   
  246. When asked at what point the Perl code would be frozen, Larry answere:
  247.   
  248.     Part of the redesign of Perl is to *allow* us to more or less freeze
  249.     the language itself.  It won't totally freeze, of course, but I think
  250.     the rate of change of the core of the language is asymptotically
  251.     approaching 0.  In fact, as time goes on, now that we have an official
  252.     extension mechanism, some of the things that are currently in the core
  253.     of the language may move out (transparently) as extensions.  This has
  254.     already happened to dbmopen().
  255.   
  256.     I've also been continuously reminding myself of what Henry Spencer
  257.     calls "second system syndrome", in which everything under the sun gets
  258.     added, resulting in a colossal kludge, like OS 360.  You'll find that
  259.     the new features in Perl 5 are all pretty minimalistic.  The
  260.     object-oriented features in particular added only one new piece of
  261.     syntax, a C++-style method call.
  262.   
  263.     : The whole idea
  264.     : Perl is to be a fast text-processing, system-maintenance, zero-startup
  265.     : time language. If it gets to be so large and complicated that it isn't
  266.     : fast-running and easy to use, it won't be to anyone's benefit.
  267.   
  268.     My motto from the start has been, "If it ain't broke, don't fix it."
  269.     I've been trying very hard not to remove those features from Perl that
  270.     make it what it is.  At the same time, a lot of streamlining has gone
  271.     into the syntax.  The new yacc file is about half the size of the old
  272.     one, and the number of official reserved words has been cut by 2/3.
  273.     All built-in functions have been unified (dualified?) as either list
  274.     operators or unary operators.
  275.   
  276.     : I really like a lot of the features in Perl, but in order for Perl to
  277.     : be useful on a long term basis, those features have to stay put. I
  278.     : bought the Camel book less than a year ago and it sounds like within
  279.     : another year it will be obsolete.
  280.   
  281.     The parts of Perl that the Camel book covers have not changed all that
  282.     much.  Most old scripts still run.  Many scripts from Perl version 1.0
  283.     still run.  We'll certainly be revising the Camel, but the new man
  284.     pages are split up such that it's pretty easy to ferret out the new
  285.     info when you want it.
  286.   
  287.     We did break a few misfeatures in going to Perl 5.  It seemed like the
  288.     first and last chance to do so.  There's a list of the
  289.     incompatibilities in the documentation. 
  290.   
  291.     : Not only is it a lot of work to recompile Perl
  292.     : on 20+ machines periodically, but it's hard to write scripts that are 
  293.     : useful in the long term if the guts of the language keep changing.
  294.     : (And if I keep having to buy new books. I keep hearing about new
  295.     : features of Perl 5 that aren't documented in any of the perl 5
  296.     : documentation that *I* can find.)
  297.   
  298.     I think you'll find a lot of folks who think that 4.036 has been a
  299.     pretty stable platform.
  300.   
  301.     Perl 5 is a special case.  I've been working on it for years.  (This is
  302.     part of the reason 4.036 has been so stable!)  There are many changes,
  303.     most of them for the better, I hope.  I don't expect the transition to
  304.     be without pain.  But that's why I stuck numbered versions out in your
  305.     bin directory, so that you can upgrade piecemeal if you like.  And
  306.     that's why I made the -w switch warn about many of the incompatibilities.
  307.   
  308.     And overriding all that, I've tried to keep it so that you don't have
  309.     to know much about the new stuff to use the old stuff.  You can upgrade
  310.     your *knowledge* piecemeal too.
  311.   
  312.     The extension mechanism is designed to take over most of the
  313.     evolutionary role from now on.  And it's set up so that, if you don't
  314.     have a particular extension, you know it right up at the front. 
  315.   
  316.     : Are there any plans to write a Perl compiler? While interpreted Perl
  317.     : is great for many applications, it would also be cool to be able to
  318.     : precompile many scripts. (Yes, I know you can undump things, but
  319.     : undump isn't provided with Perl and I haven't found a copy.) The
  320.     : creation of a perl library and dynamically-loadable modules seems
  321.     : like a step in that direction.  
  322.   
  323.     Yes, part of the design of Perl 5 was to make it *possible* to write a 
  324.     compiler for it.  It could even be done as an extension module, I
  325.     suppose.  Anyone looking for a master's thesis topic?
  326.   
  327.     In summary, almost every concern that you might think of has already
  328.     been (at least) thought about.  In a perfect world, every concern
  329.     could be addressed perfectly.  But in this world we just have to slog
  330.     through.
  331.   
  332.  
  333. 1.7) What's the difference between "perl" and "Perl"?
  334.  
  335.     32!  [ ord('p') - ord('P') ]  (Shouldn't that be 42, the Answer to the
  336.         Great Question of Life, the Universe, and Everything?  ;) 
  337.  
  338.     Larry now uses "Perl" to signify the language proper and "perl" the
  339.     implementation of it, i.e. the current interpreter.  Hence Tom's
  340.     quip that "Nothing but perl can parse Perl."
  341.  
  342.     On the other hand, the aesthetic value of casewise parallelism in
  343.     "awk", "sed", and "perl" as much require the lower-case version as "C",
  344.     "Pascal", and "Perl" require the upper-case version.  It's also easier
  345.     to type "Perl" in typeset print than to be constantly switching in
  346.     Courier. :-) 
  347.     
  348.     In other words, it doesn't matter much, especially if all you're doing
  349.     is hearing someone talk about the language; case is hard to distinguish
  350.     aurally. 
  351.  
  352.  
  353. 1.8) Is it a perl program or a perl script?
  354.  
  355.     It depends on whether you are talking about the perl binary or
  356.     something that you wrote using perl.  And, actually, even this isn't
  357.     necessarily true.
  358.  
  359.     "Standard" UNIX terminology is (roughly) this:  programs are compiled
  360.     into machine code once and run multiple times, scripts are translated
  361.     (by a program) each time they are used.  However, some say that a
  362.     program is anything written which is executed on a computer system.
  363.     Larry considers it a program if it is set in stone and you can't change
  364.     it, whereas if you can go in and hack at it, it's a script.  Of course,
  365.     if you have the source code, that makes just about anything a
  366.     script.  ;)
  367.  
  368.     In general, it probably doesn't really matter.  The terms are used
  369.     interchangeably.  If you particularly like one or the other, use it.  If
  370.     you want to call yourself a perl programmer, call them programs.  If
  371.     you want to call yourself a perl scripter, call them scripts.  Randal*
  372.     and I (at least) will call them hacks.  (See question 2.10 ;)
  373.  
  374. 1.9) Is perl difficult to learn?
  375.     
  376.     Not at all.  Many people find Perl extremely easy to learn.  There are
  377.     at least three main reasons for this.
  378.  
  379.     The first reason is that most of Perl has been derived from standard
  380.     utilities, tools, and languages that you are (probably) already
  381.     familiar with.  If you have any knowledge of the C programming language
  382.     and standard C library, the Unix Shell, sed and awk, Perl should be
  383.     simple and fun for you to learn.
  384.  
  385.     The second reason that Perl is easy to learn is that you only have to
  386.     know a very small subset of Perl to be able to get useful results.  In
  387.     fact, once you can master
  388.  
  389.         #!/usr/local/bin/perl
  390.      print "Hello, world\n";
  391.  
  392.     you can start writing Perl scripts.  In fact, you will probably never
  393.     have to (or be able to) know everything about Perl.  As you feel the
  394.     need or desire to use more sophisticated features (such as C structures
  395.     or networking), you can learn these as you go.  The learning curve for
  396.     Perl is not a steep one, especially if you have the headstart of having 
  397.     a background in UNIX.  Rather, its learning curve is gentle and
  398.     gradual, but it *is* admittedly rather long. 
  399.  
  400.     The third reason is that you can get immediate results from your
  401.     scripts.  Unlike a normal compiled language (like C or Pascal, for
  402.     example), you don't have to continually recompile your program every
  403.     time you change one little thing.  Perl allows you to experiment and
  404.     test/debug quickly and easily.  This ease of experimentation flattens
  405.     the learning curve even more.
  406.  
  407.     If you don't know C or UNIX at all, it'll be a steeper learning curve,
  408.     but what you then learn from Perl will carry over into other areas,
  409.     like using the C library, UNIX system calls, regular expressions, and 
  410.     associative arrays, just to name a few.  To know Perl is to know UNIX,
  411.     and vice versa. 
  412.  
  413.  
  414. 1.10) Should I program everything in Perl?
  415.  
  416.     Most definitely.  In fact, you should delete the binaries for sed, awk,
  417.     cc, gcc, grep, rm, ls, cat... well, just delete your /bin directory.
  418.  
  419.     But seriously, of course you shouldn't.  As with any job, you should
  420.     use the appropriate tool for the task at hand.  Just because a hammer 
  421.     will put screws into a piece of board, you probably don't want to do
  422.     that.
  423.  
  424.     While it's true that the answer to the question "Can I do (some
  425.     arbitrary task) in Perl?" is almost always "yes", that doesn't mean
  426.     this is necessarily a good thing to do.  For many people, Perl serves
  427.     as a great replacement for shell programming.  For a few people, it
  428.     also serves as a replacement for most of what they'd do in C.  But for
  429.     some things, Perl just isn't the optimal choice, such as tasks
  430.     requiring very complex data structures.
  431.  
  432. 1.11) How does Perl compare with other scripting languages, like Tcl, Python
  433.      or REXX?
  434.  
  435.     REXX is an interpreted programming language first seen on IBM systems.
  436.     Python is an interpreted programming language by Guido van Rossum*.
  437.     TCL is John Ousterhout*'s embeddable command language, designed just
  438.     for embedded command extensions, but lately used for larger
  439.     applications.  TCL's most intriguing feature for many people is the
  440.     tcl/tk toolset that allows for interpreted X-based tools.  Others use
  441.     it for its "expect" extension.
  442.  
  443.     To avoid any flamage, if you really want to know the answer to this
  444.     question, probably the best thing to do is try to write equivalent
  445.     code to do a set of tasks.  All three have their own newsgroups in
  446.     which you can learn about (but hopefully not argue about) these
  447.     languages.
  448.  
  449.     To find out more about these or other languages, you might also check
  450.     out David Muir Sharnoff*'s posting "Catalog of Compilers, Interpreters,
  451.     and Other Language Tools" which he posts to comp.lang.misc,
  452.     comp.sources.d, comp.archives.admin, and news.answers newsgroups.  It's
  453.     a comprehensive treatment of many different languages.  (Caveat lector:
  454.     he considers Perl's syntax "unappealing".)
  455.  
  456.  
  457. 1.12) How can I get Perl over the Internet?
  458.  
  459.     Perl is available from any comp.sources.misc archive.  You can use an
  460.     archie server (see the alt.sources FAQ in news.answers) to find these
  461.     if you want.
  462.  
  463.     Volume    Issues    Patchlevel and Notes
  464.     ------    ------    ------------------------------------------------
  465.       18    19-54    Patchlevel 3, Initial posting.
  466.       20    56-62    Patches 4-10    
  467.  
  468.     Since 1993, a number of archives have sprung up specifically for Perl
  469.     and Perl related items.  Larry maintains the official distribution
  470.     site (for both perl4.036 and perl5) at netlabs.  Probably the largest
  471.     archive is at the University of Florida.  In order of probability these
  472.     sites will have the sources.
  473.  
  474.     Site            IP                Directory and notes    
  475.     -----------        -------        ------------------------------- 
  476.     North America:
  477.     ftp.netlabs.com     192.94.48.152   /pub/outgoing/perl[VERSION]/
  478.     ftp.cis.ufl.edu        128.227.100.198 /pub/perl/src/[VERSION]/
  479.         prep.ai.mit.edu        18.71.0.38         /pub/gnu/perl5.000.tar.gz
  480.         ftp.uu.net          192.48.96.9        /languages/perl/perl5.000.tar.gz
  481.         ftp.khoros.unm.edu  198.59.155.28   /pub/perl/perl5.000.tar.gz
  482.         ftp.cbi.tamucc.edu  165.95.1.3        /pub/duff/Perl/perl5.000.tar.gz
  483.     ftp.metronet.com    192.245.137.1   /pub/perl/sources/
  484.         genetics.upenn.edu  128.91.200.37   /perl5/perl5_000.zip
  485.  
  486.     Europe:
  487.         ftp.cs.ruu.nl        131.211.80.17   /pub/PERL/perl5.0/perl5.000.tar.gz
  488.         ftp.funet.fi        128.214.248.6   /pub/languages/perl/ports/perl5/perl5.000.tar.gz
  489.         ftp.zrz.tu-berlin.de 130.149.4.40   /pub/unix/perl/perl5.000.tar.gz
  490.         src.doc.ic.ac.uk    146.169.17.5    /packages/perl5/perl5.000.tar.gz
  491.   
  492.     Australia:
  493.         sungear.mame.mu.oz.au 128.250.209.2 /pub/perl/src/5.0/perl5.000.tar.gz
  494.  
  495.     If there is a site in Asia or Japan, please tell us about it.  Thanks! 
  496.  
  497.     You can also retrieve perl via non-ftp methods:
  498.   
  499.         http: //src.doc.ic.ac.uk/packages/perl5/perl5.000.tar.gz
  500.         gopher:       //src.doc.ic.ac.uk/0/packages/perl5/perl5.000.tar.gz
  501.  
  502.  
  503. 1.13) How can I get Perl via Email?
  504.  
  505.     The following is a list of known ftpmail sites.  Please attempt to use
  506.     the site closest to you with the ftp archive closest to it.  Many of
  507.     these sites already have perl on them.  For information on how to use
  508.     one of these sites, send email containing the word "help" to the
  509.     address.
  510.  
  511.     United States:
  512.         Massachusetts:    ftpmail@decwrl.dec.com
  513.         New Jersey:        bitftp@pucc.princeton.edu
  514.         North Carolina:    ftpmail@sunsite.unc.edu
  515.  
  516.     Europe/UK:
  517.         Germany:        ftpmail@ftp.uni-stuttgart.de
  518.                 bitftp@vx.gmd.de
  519.         UK:            ftpmail@doc.ic.ac.uk
  520.  
  521.     Australia:        ftpmail@cs.uow.edu.au
  522.  
  523.     Henk P Penning* suggests that if you are in Europe you should try the
  524.     following (if you are in Germany or the UK, you should probably use one
  525.     of the servers listed above): 
  526.  
  527.         Email: Send a message to 'mail-server@cs.ruu.nl' containing:
  528.      begin
  529.      path your_email_address
  530.      send help
  531.      send PERL/INDEX
  532.      end
  533.     The path-line may be omitted if your message contains a normal
  534.     From:-line.  You will receive a help-file and an index of the
  535.     directory that contains the Perl stuff.
  536.  
  537.     If all else fails, mail to Larry usually suffices.
  538.  
  539.  
  540. 1.14) How can I get Perl via UUCP?
  541.  
  542.     There currently is no way of getting Perl via UUCP.  If anyone knows of
  543.     a way, please contact me.  The OSU site has discontinued the service.
  544.  
  545.  
  546. 1.15) Are there other ways of getting perl?
  547.  
  548.     Another possibility is to use UUNET, although they charge you for it.
  549.     You have been duly warned.  Here's the advertisement: 
  550.  
  551.            Anonymous Access to UUNET's Source Archives
  552.  
  553.                  1-900-GOT-SRCS
  554.  
  555.     UUNET now provides access to its extensive collection of UNIX
  556.     related sources to non- subscribers.  By  calling  1-900-468-7727
  557.     and  using the login "uucp" with no password, anyone may uucp any
  558.     of UUNET's on line source collection.  Callers will be charged 40
  559.     cents  per  minute.   The charges will appear on their next tele-
  560.     phone bill.
  561.  
  562.      The file uunet!/info/help contains instructions.   The  file
  563.     uunet!/index//ls-lR.Z  contains  a  complete  list  of  the files 
  564.     available  and is  updated daily.   Files ending  in Z need to be 
  565.     uncompressed before being used.  The file uunet!~/compress.tar is
  566.     a tar archive containing the C sources for the uncompress program. 
  567.  
  568.      This service provides a  cost  effective  way  of  obtaining
  569.     current  releases  of sources without having to maintain accounts
  570.     with UUNET or some other service.  All modems  connected  to  the
  571.     900  number  are  Telebit T2500 modems.  These modems support all
  572.     standard modem speeds including PEP, V.32 (9600), V.22bis (2400),
  573.     Bell  212a  (1200), and Bell 103 (300).  Using PEP or V.32, a 1.5
  574.     megabyte file such as the GNU C compiler would cost $10  in  con-
  575.     nect  charges.   The  entire  55  megabyte X Window system V11 R4
  576.     would cost only $370 in connect time.  These costs are less  than
  577.     the  official  tape  distribution fees and they are available now
  578.     via modem.
  579.  
  580.               UUNET Communications Services
  581.            3110 Fairview Park Drive, Suite 570
  582.              Falls Church, VA 22042
  583.              +1 703 876 5050 (voice)
  584.               +1 703 876 5059 (fax)
  585.                 info@uunet.uu.net
  586.  
  587.  
  588. 1.16) Has perl been ported to machine FOO?
  589.  
  590.     Perl runs on virtually all Unix machines simply by following the hints
  591.     file and instructions in the Configure script.  This auto-configuration
  592.     script allows Perl to compile on a wide variety of platforms by
  593.     modifying the machine specific parts of the code.  For most Unix
  594.     systems, or VMS systems for v5 perl, no porting is required.  Try to
  595.     compile Perl on your machine.  If you have problems, examine the README
  596.     file carefully.  If all else fails, send a message to comp.lang.perl
  597.     and crosspost to comp.sys.[whatever], there's probably someone out
  598.     there that has already solved your problem and will be able to help you
  599.     out. 
  600.  
  601.     Perl has been ported to many non-Unix systems, although currently there
  602.     are no v5 ports.  All of the following are mirrored at
  603.     ftp.cis.ufl.edu:/pub/perl/src/[OS]/.  The following are the (known)
  604.     official distribution points.  Please contact the porters directly
  605.     (when possible) in case of questions on these ports.
  606.  
  607.     * MS-DOS binaries and source are available at ftp.ee.umanitoba.ca
  608.       [130.179.8.47] in /pub/msdos/perl  
  609.       There are currently half a dozen different ports for MS-DOS.
  610.       BigPerl4 (v3) is perl4.036 compiled with the Watcom C/386
  611.       compiler (32-bit, flat-memory model C compiler) with the
  612.       following features:
  613.         * Up to 32MB of memory can be used.
  614.         * Supports virtual memory.
  615.         * Works under Windows 3.1 (however, a second copy of perl cannot
  616.           be spawned under Windows).
  617.         * The perl debugger can be used.
  618.         * Contains GDBM support.
  619.  
  620.     * Windows/NT binaries are available from ftp.cis.ufl.edu.  Does
  621.       anyone know the official distribution point?  I got these from
  622.       archive.cis.ohio-state.edu quite awhile back.
  623.  
  624.     * Machintosh binaries and source are available from nic.switch.ch
  625.       [130.59.1.40] in /software/mac/perl.
  626.       Version 4.1.3 is perl4.036 compiled with the MPW C compiler
  627.         * Mac_Perl_413_src.sit.bin        Sources
  628.         * Mac_Perl_413_tool.sit.bin        MPW Tool
  629.         * Mac_Perl_413_appl.sit.bin        Standalone Application
  630.       There is a mailing list for discussing Macintosh Perl.  Contact
  631.       "mpw-perl-request@iis.ee.ethz.ch".
  632.  
  633.       Timothy Murphy* also ported a version of perl to the Macintosh
  634.       using Think C.  It has probably been abandoned in favour of the
  635.       MPW port, but is still available at ftp.maths.tcd.ie
  636.       [134.266.81.10] in the directory /pub/Mac/perl-4.035/.
  637.  
  638.     * OS/2 sources are also available at ftp.cis.ufl.edu in
  639.       /pub/perl/src/os2.  This appears to have been abandoned and added
  640.       to the official distribution.  See the directory os2 in the perl5
  641.       sources.
  642.  
  643.     * VMS systems should be able to build directly from the standard
  644.       distribution.
  645.  
  646.  
  647. 1.17) How do I get Perl to compile on Solaris?
  648.  
  649.     The following directions are for perl, version 4.  Perl, version 5,
  650.     should compile more easily.  If not, send mail to The Perl Porters
  651.     Mailing List (perl5-porters@isu.edu)
  652.  
  653.     John Lees* reports:
  654.  
  655.         I have built perl on Solaris 2.1, 2.2 beta, and 2.2 FCS. Take
  656.     /usr/ucb out of your path and do not use any BSD/UCB libraries.
  657.     Only -lsocket, -lnsl, and -lm are needed. You can use the hint for
  658.     Solaris 2.0, but the one for 2.1 is wrong. Do not use vfork. Do not
  659.     use -I/usr/ucbinclude.  The result works fine for me, but of couse
  660.     does not support a couple of BSDism's.
  661.  
  662.     Casper H.S. Dik* reports
  663.  
  664.         You must remove all the references to /usr/ucblib AND
  665.         /usr/ucbinclude.  And ignore the Solaris_2.1 hints. They are wrong.
  666.         The undefining of vfork() probably has to do with the confusion it 
  667.         gives to the compilers.  If you use cc, you mustn't compile
  668.     util.c/tutil.c  with -O.  I only used the following libs: -lsocket 
  669.     -lnsl -lm (there is a problem with -lmalloc)
  670.  
  671.     Michael D'Errico* reports:
  672.  
  673.         If you are using Solaris 2.x, the signal handling is broken.  If
  674.     you set up a signal handler such as 'ripper' it will be forgotten
  675.     after the first time the signal is caught.  To fix this, you need
  676.     to recompile Perl.  Just add '#define signal(x,y) sigset((x),(y))'
  677.     after the '#include <signal.h>' directive in each file that it
  678.     occurs, then make it again. 
  679.  
  680.  
  681. 1.18) How do I get Perl to compile on a Next?
  682.  
  683.     According to Andreas Koenig*, under NeXTstep 3.2, both perl4.036 and
  684.     perl5.000 compile with the supplied hints file. 
  685.  
  686.     However, Bill Eldridge* provides this message to help get perl4.036 on
  687.     NeXTstep 3.0 to work: 
  688.  
  689.         To get perl to compile on NeXTs, you need to combine the ANSI
  690.         and BSD headers:
  691.  
  692.         cd /usr/include
  693.         mkdir ansibsd
  694.         cd ansibsd
  695.         ln -s ../ansi
  696.         ln -s ../bsd
  697.  
  698.         Then, follow the configuration instructions for NeXTs, *replacing*
  699.         all mention of -I/usr/include/ansi or -I/usr/include/bsd with
  700.         -I/usr/include/ansibsd.
  701.  
  702.  
  703. 1.19) What extensions are available from Perl and where can I get them?
  704.   
  705.     Some of the more popular extensions include those for windowing,
  706.     graphics, or data base work.  See perlmod(1). 
  707.   
  708.     Tk (as in tcl/tk, but sans tcl) 
  709.  
  710.       ftp://ftp.cis.ufl.edu/pub/perl/src/tkperl/tkperl5a5.tar.gz
  711.       ftp://ftp.khoros.unm.edu/pub/perl/extensions/tkperl5a5.tar.gz
  712.       ftp://ftp.metronet.com/pub/perlinfo/perl5/tkperl/tkperl5a5.tar.gz
  713.       ftp://ftp.cs.ruu.nl/pub/PERL/perl5.0/tkperl5a5.tar.gz
  714.       ftp://black.ox.ac.uk/src/ALPHA/tkperl5a5.tar.gz
  715.  
  716.     Curses (standard C library)
  717.       ftp://ftp.ncsu.edu/pub/math/wsetzer/cursperl5a6.tar.gz
  718.       ftp://ftp.metronet.com/pub/perlinfo/perl5/cursperl5a6.tar.gz
  719.       ftp://ftp.cs.ruu.nl/pub/PERL/perl5.0/cursperl5a6.tar.gz
  720.  
  721.     Msql (SQL)
  722.       ftp://ftp.zrz.TU-Berlin.DE/pub/unix/perl/MsqlPerl-a1.tgz
  723.       ftp://ftp.khoros.unm.edu/pub/perl/extensions/MsqlPerl-a1.tgz
  724.       ftp://ftp.metronet.com/pub/perlinfo/perl5/MsqlPerl5-a1.tgz
  725.       ftp://ftp.cs.ruu.nl/pub/PERL/perl5.0/MsqlPerl-a1.tar.gz
  726.  
  727.     Sx (Athena & Xlib)
  728.       ftp://ftp.pasteur.fr/pub/Perl/Sx.tar.gz
  729.       ftp://ftp.khoros.unm.edu/pub/perl/extensions/Sx.tar.gz
  730.       ftp://ftp.metronet.com/pub/perlinfo/perl5/Sx.tar.gz
  731.       ftp://ftp.cs.ruu.nl/pub/PERL/perl5.0/PerlDoc.ps.gz
  732.  
  733. 1.20) What is dbperl and where can I get it?
  734.  
  735.     Many database-oriented extensions to Perl have been written.
  736.     Basically, these use the usub mechanism (see the usub/ subdirectory) in
  737.     the source distribution) to link in a database library, allowing
  738.     embedded calls to Informix, Ingres, Interbase, Oracle and Sybase.
  739.  
  740.     Here are the authors of the various extensions:
  741.  
  742.     What            Target DB       Who
  743.     --------        -----------     ----------------------------------------
  744.     ?Infoperl       Informix        Kurt Andersen (kurt@hpsdid.sdd.hp.com)
  745.     Ingperl        Ingres        Tim Bunce (timbo@ig.co.uk) and Ted Lemon
  746.     Interperl       Interbase       Buzz Moschetti (buzz@bear.com)
  747.     Isqlperl        Informix        William Hails, bill@tardis.co.uk
  748.     Oraperl         Oracle          Kevin Stock (kstock@Auspex.com)
  749.     Pgperl        Postgres        Igor Metz (metz@iam.unibe.ch)
  750.     *Sqlperl        Ingres          Ted Lemon (mellon@ncd.com)
  751.     Sybperl         Sybase          Michael Peppler (mpeppler@itf.ch)
  752.     Uniperl        Unify 5.0        Rick Wargo (rickers@coe.drexel.edu)
  753.  
  754.     ? Does this one still exist?
  755.     * Sqlperl appears to have been subsumed by Ingperl
  756.  
  757.     Buzz Moschetti* has organized a project to create a higher level
  758.     interface to will allow you to write your queries in a database-
  759.     independent fashion.  If this type of project interests you, send mail
  760.     to <perldb-interest-request@vix.com> and asked to be placed on the
  761.     "perldb-interest" mailing lists.
  762.  
  763.     Here's a bit of advertising from Buzz:
  764.  
  765.     Perl is an interpreted language with powerful string, scalar, and
  766.     array processing features developed by Larry Wall that "nicely
  767.     bridges the functionality gap between sh(1) and C."  Since
  768.     relational DB operations are typically textually oriented, perl is
  769.     particularly well-suited to manage the data flows.  The C source
  770.     code, which is available free of charge and runs on many platforms,
  771.     contains a user-defined function entry point that permits a
  772.     developer to extend the basic function set of the language.  The
  773.     DBperl Group seeks to exploit this capability by creating a
  774.     standardized set of perl function extensions (e.g. db_fetch(),
  775.     db_attach()) based the SQL model for manipulating a relational DB,
  776.     thus providing a portable perl interface to a variety of popular
  777.     RDMS engines including Sybase, Oracle, Ingres, Informix, and
  778.     Interbase.  In theory, any DB engine that implements a dynamic SQL
  779.     interpreter in its HLI can be bolted onto the perl front end with
  780.     predicatable results, although at this time backends exist only for
  781.     the aforementioned five DB engines. 
  782.  
  783.     The official archive for DBperl extensions is ftp.demon.co.uk:
  784.     /pub/perl/db.  It's the home of the evolving DBperl API Specification.
  785.     Here's an extract from the updated README there:
  786.  
  787.     DBI/        The home of the DBI archive. To join the DBI mailing list
  788.                 send your request to perldb-interest-REQUEST@vix.com
  789.  
  790.     DBD/        Database Drivers for the DBI ...
  791.      
  792.     Oracle/      By Tim Bunce (not yet ready!) 
  793.     Ingres/      By Tim Bunce (not yet started!) 
  794.  
  795.     mod/           Other Perl 5 Modules and Extensions ...
  796.  
  797.     Sybperl/    By Michael Peppler, mpeppler@itf.ch
  798.  
  799.  
  800.     perl4/         Perl 4 extensions (using the usub C interface)
  801.  
  802.        oraperl/   ORACLE 6 & 7  By Kevin Stock (sadly no longer on the net)
  803.        sybperl/   SYBASE 4      By Michael Peppler, mpeppler@itf.ch
  804.        ingperl/   INGRES        By Tim Bunce timbo@ig.co.uk and Ted Lemon
  805.        isqlperl/  INFORMIX      By William Hails, bill@tardis.co.uk
  806.        interperl/ INTERBASE     By Buzz Moschetti, buzz@bear.com
  807.        oraperl/   ORACLE 6 & 7  By Kevin Stock (sadly no longer on the net)
  808.        sybperl/   SYBASE 4      By Michael Peppler, mpeppler@itf.ch
  809.        ingperl/   INGRES        By Tim Bunce timbo@ig.co.uk and Ted Lemon
  810.        isqlperl/  INFORMIX      By William Hails, bill@tardis.co.uk
  811.        interperl/ INTERBASE     By Buzz Moschetti, buzz@bear.com
  812.        uniperl/   UNIFY 5.0     By Rick Wargo, rickers@coe.drexel.edu
  813.        pgperl/    POSTGRES      By Igor Metz, metz@iam.unibe.ch
  814.  
  815.        btreeperl/ NDBM perl extensions.   By John Conover, john@johncon.com
  816.        ctreeperl/ C-Tree perl extensions. By John Conover, john@johncon.com
  817.        duaperl/   X.500 Directory User Agent. By Eric Douglas.
  818.   
  819.     scripts/       Perl and shell scripts
  820.   
  821.        rdb/       RDB is a perl RDBMS for ASCII files. By Walt Hobbs,
  822.                     hobbs@rand.org 
  823.        shql/      SHQL is an interactive SQL database engine.  Written as a
  824.                     shell script, SHQL interprets SQL commands and
  825.                     manipulates flat files based on those commands. By
  826.                     Bruce Momjian, root@candle.uucp 
  827.        xbase/     Perl scripts for accessing xBase style files (dBase III) 
  828.  
  829.  
  830.    refinfo/       Reference information
  831.       
  832.        sqlsyntax/ Yacc and lex syntax and C source code for SQL1 and SQL2
  833.             from ftp.uu.net:/pub/uunet/published/oreilly/nutshell/yacclex, 
  834.             and a draft SQL3 syntax from Jeff Fried <jfried@informix.com>+      
  835.        formats/   Details of file formats such as Lotus 1-2-3 .WK1
  836.  
  837.     There are also a number of non SQL database interfaces for perl
  838.     available from ftp.demon.co.uk.  These include:
  839.  
  840.     Directory    Target System    Authors and notes
  841.     ---------    -------------    -------------------------------------------
  842.     btreeperl    NDBM extension    John Conover (john@johncon.com)
  843.     ctreeperl    CTree extension John Conover (john@johncon.com)
  844.     duaperl    X.500 DUA    Eric Douglas
  845.     rdb        RDBMS        Walt Hobbs (hobbs@rand.org)
  846.     shql    SQL Engine    Bruce Momjian (root@candle.uucp)
  847.  
  848.  
  849. 1.21) Which DBM should I use?
  850.  
  851.     As shipped, Perl (version 5) comes with interfaces for several DBM
  852.     packages (SDBM, old DBM, NDBM, GDBM, Berkeley DBM) that are not supplied  
  853.     but either come with your system are readily accessible via FTP.  SDBM
  854.     is guaranteed to be there.  For a comparison, see AnyDBM_File(3pm)
  855.     and DB_File(3pm).
  856.  
  857.     
  858. 1.22) Is there an SNMP aware Perl?
  859.  
  860.     snmperl was written by Guy Streeter (streeter@ingr.com), and was
  861.     posted in late February 1993 to comp.protocols.snmp.  It can be found
  862.     archived at one of two (known) places:
  863.  
  864.     Host liasun3.epfl.ch
  865.  
  866.     Location: /pub/net/snmp
  867.            FILE -rw-rw-r--       3407  Aug 11 1992  snmperl.README
  868.            FILE -rw-r--r--      17678  Aug 11 1992  snmperl.tar.Z
  869.  
  870.     Host ftp.cis.ufl.edu
  871.     Location: /pub/perl/scripts/snmp
  872.  
  873.     Here is the gist of the README:
  874.  
  875.     README  $Revision: 2.3 $
  876.  
  877.     This directory contains the source code to add callable C subroutines
  878.     to perl.  The subroutines implement the SNMP functions "get",
  879.     "getnext", and "set".  They use the freely-distributable SNMP package
  880.     (version 1.1b) from CMU.
  881.  
  882.     USE:
  883.       There are four subroutines defined in the callable interface:
  884.     snmp_get, snmp_next, snmp_set, and snmp_error.
  885.  
  886.       snmp_get and snmp_next implement the GET and GETNEXT operations,
  887.     respectively.  The first two calling arguments are the hostname and
  888.     Community string.  The IP address of the host, as a dotted-quad ASCII
  889.     string, may be used as the hostname.  The rest of the calling
  890.     arguments are a list of variables.  See the CMU package documentation
  891.     for how variables may be specified.
  892.       snmp_set also takes hostname and Community string as arguments.  The
  893.     remaining arguments are a list of triples consisting of variable name,
  894.     variable type, and value.  The variable type is a string, such as
  895.     "INTEGER" or "IpAddress".
  896.       snmp_get, snmp_next, and snmp_set return a list containing
  897.     alternating variables and values.  snmp_get and snmp_next will simply
  898.     omit non-existent variables on return.  snmp_set will fail completely
  899.     if one of the specified variables does not exist (or is read-only).
  900.       snmp_error will return a text string containing some error
  901.     information about the most recent snmp_get|next|set call, if it had an
  902.     error.
  903.  
  904.     OTHER NOTES:
  905.       I didn't find all the places where the CMU library writes to stderr
  906.     or calls exit() directly.
  907.       The changes I made to mib.c involve the formatting of variable values
  908.     for return to the caller.  I took out the descriptive prefix so the
  909.     string contains only the value.
  910.       Enumerated types are returned as a string containing the symbolic
  911.     representation followed in parentheses by the numeric.
  912.  
  913.     DISTRIBUTION and OWNERSHIP
  914.       perl and the CMU SNMP package have their own statements.  Read them.
  915.     The work I've done is free and clear.  Just don't say you wrote it if
  916.     you didn't, and don't say I wrote it if you change it.
  917.  
  918.     Guy Streeter
  919.     streeter@ingr.com
  920.     April 1, 1992 (not a joke!)
  921. Stephen P Potter        spp@vx.com        Varimetrix Corporation
  922. 2350 Commerce Park Drive, Suite 4                Palm Bay, FL 32905
  923. (407) 676-3222                           CAD/CAM/CAE/Software
  924.  
  925.