added patch for -i'foo*bar', made code somewhat simpler, tweaked doc
[p5sagit/p5-mst-13.2.git] / pod / perlfaq2.pod
1 =head1 NAME
2
3 perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.20 $, $Date: 1998/07/05 15:07:20 $)
4
5 =head1 DESCRIPTION
6
7 This section of the FAQ answers questions about where to find
8 source and documentation for Perl, support and training, and
9 related matters.
10
11 =head2 What machines support Perl?  Where do I get it?
12
13 The standard release of Perl (the one maintained by the perl
14 development team) is distributed only in source code form.  You can
15 find this at http://www.perl.com/CPAN/src/latest.tar.gz, which is a
16 gzipped archive in POSIX tar format.  This source builds with no
17 porting whatsoever on most Unix systems (Perl's native environment),
18 as well as Windows NT, Plan 9, VMS, QNX, OS/2, and the Amiga.
19
20 Binary distributions for various platforms can be found
21 http://www.perl.com/CPAN/ports/ directory.  Some of these ports (especially
22 the ones not part of the standard sources) may behave differently
23 than what is documented in the standard source documentation.  These
24 differences can be either positive (e.g. extensions for the features of the
25 particular platform that are not supported in the source release of perl)
26 or negative (e.g. might be based upon a less current source release of perl).
27
28 A useful FAQ for Win32 Perl users is:
29 http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
30 [This FAQ is seriously outdated as of May 1998--it is only relevant to
31 the perl that ActiveState distributes, especially where it describes
32 various inadequacies and differences with the standard perl extension
33 build support.]
34
35 =head2 How can I get a binary version of Perl?
36
37 If you don't have a C compiler because for whatever reasons your
38 vendor did not include one with your system, the best thing to do is
39 grab a binary version of gcc from the net and use that to compile perl
40 with.  CPAN only has binaries for systems that are terribly hard to
41 get free compilers for, not for Unix systems.
42
43 Your first stop should be http://www.perl.com/CPAN/ports to see what
44 information is already available.  A simple installation guide for
45 MS-DOS is available at http://www.cs.ruu.nl/~piet/perl5dos.html , and
46 similarly for Windows 3.1 at http://www.cs.ruu.nl/~piet/perlwin3.html
47 .
48
49 =head2 I don't have a C compiler on my system.  How can I compile perl?
50
51 Since you don't have a C compiler, you're doomed and your vendor
52 should be sacrificed to the Sun gods.  But that doesn't help you.
53
54 What you need to do is get a binary version of gcc for your system
55 first.  Consult the Usenet FAQs for your operating system for
56 information on where to get such a binary version.
57
58 =head2 I copied the Perl binary from one machine to another, but scripts don't work.
59
60 That's probably because you forgot libraries, or library paths differ.
61 You really should build the whole distribution on the machine it will
62 eventually live on, and then type C<make install>.  Most other
63 approaches are doomed to failure.
64
65 One simple way to check that things are in the right place is to print out
66 the hard-coded @INC which perl is looking for.
67
68         perl -e 'print join("\n",@INC)'
69
70 If this command lists any paths which don't exist on your system, then you
71 may need to move the appropriate libraries to these locations, or create
72 symlinks, aliases, or shortcuts appropriately.
73
74 You might also want to check out L<perlfaq8/"How do I keep my own
75 module/library directory?">.
76
77 =head2 I grabbed the sources and tried to compile but gdbm/dynamic loading/malloc/linking/... failed.  How do I make it work?
78
79 Read the F<INSTALL> file, which is part of the source distribution.
80 It describes in detail how to cope with most idiosyncracies that the
81 Configure script can't work around for any given system or
82 architecture.
83
84 =head2 What modules and extensions are available for Perl?  What is CPAN?  What does CPAN/src/... mean?
85
86 CPAN stands for Comprehensive Perl Archive Network, a huge archive
87 replicated on dozens of machines all over the world.  CPAN contains
88 source code, non-native ports, documentation, scripts, and many
89 third-party modules and extensions, designed for everything from
90 commercial database interfaces to keyboard/screen control to web
91 walking and CGI scripts.  The master machine for CPAN is
92 ftp://ftp.funet.fi/pub/languages/perl/CPAN/, but you can use the
93 address http://www.perl.com/CPAN/CPAN.html to fetch a copy from a
94 "site near you".  See http://www.perl.com/CPAN (without a slash at the
95 end) for how this process works.
96
97 CPAN/path/... is a naming convention for files available on CPAN
98 sites.  CPAN indicates the base directory of a CPAN mirror, and the
99 rest of the path is the path from that directory to the file.  For
100 instance, if you're using ftp://ftp.funet.fi/pub/languages/perl/CPAN
101 as your CPAN site, the file CPAN/misc/japh file is downloadable as
102 ftp://ftp.funet.fi/pub/languages/perl/CPAN/misc/japh .
103
104 Considering that there are hundreds of existing modules in the
105 archive, one probably exists to do nearly anything you can think of.
106 Current categories under CPAN/modules/by-category/ include perl core
107 modules; development support; operating system interfaces; networking,
108 devices, and interprocess communication; data type utilities; database
109 interfaces; user interfaces; interfaces to other languages; filenames,
110 file systems, and file locking; internationalization and locale; world
111 wide web support; server and daemon utilities; archiving and
112 compression; image manipulation; mail and news; control flow
113 utilities; filehandle and I/O; Microsoft Windows modules; and
114 miscellaneous modules.
115
116 =head2 Is there an ISO or ANSI certified version of Perl?
117
118 Certainly not.  Larry expects that he'll be certified before Perl is.
119
120 =head2 Where can I get information on Perl?
121
122 The complete Perl documentation is available with the perl distribution.
123 If you have perl installed locally, you probably have the documentation
124 installed as well: type C<man perl> if you're on a system resembling Unix.
125 This will lead you to other important man pages, including how to set your
126 $MANPATH.  If you're not on a Unix system, access to the documentation
127 will be different; for example, it might be only in HTML format.  But all
128 proper perl installations have fully-accessible documentation.
129
130 You might also try C<perldoc perl> in case your system doesn't
131 have a proper man command, or it's been misinstalled.  If that doesn't
132 work, try looking in /usr/local/lib/perl5/pod for documentation.
133
134 If all else fails, consult the CPAN/doc directory, which contains the
135 complete documentation in various formats, including native pod,
136 troff, html, and plain text.  There's also a web page at
137 http://www.perl.com/perl/info/documentation.html that might help.
138
139 Many good books have been written about Perl -- see the section below
140 for more details.
141
142 =head2 What are the Perl newsgroups on USENET?  Where do I post questions?
143
144 The now defunct comp.lang.perl newsgroup has been superseded by the
145 following groups:
146
147     comp.lang.perl.announce             Moderated announcement group
148     comp.lang.perl.misc                 Very busy group about Perl in general
149     comp.lang.perl.moderated            Moderated discussion group
150     comp.lang.perl.modules              Use and development of Perl modules
151     comp.lang.perl.tk                   Using Tk (and X) from Perl
152
153     comp.infosystems.www.authoring.cgi  Writing CGI scripts for the Web.
154
155 Actually, the moderated group hasn't passed yet, but we're
156 keeping our fingers crossed.
157
158 There is also USENET gateway to the mailing list used by the crack
159 Perl development team (perl5-porters) at
160 news://news.perl.com/perl.porters-gw/ .
161
162 =head2 Where should I post source code?
163
164 You should post source code to whichever group is most appropriate,
165 but feel free to cross-post to comp.lang.perl.misc.  If you want to
166 cross-post to alt.sources, please make sure it follows their posting
167 standards, including setting the Followup-To header line to NOT
168 include alt.sources; see their FAQ for details.
169
170 If you're just looking for software, first use Alta Vista, Deja News, and
171 search CPAN.  This is faster and more productive than just posting
172 a request.
173
174 =head2 Perl Books
175
176 A number of books on Perl and/or CGI programming are available.  A few of
177 these are good, some are ok, but many aren't worth your money.  Tom
178 Christiansen maintains a list of these books, some with extensive
179 reviews, at http://www.perl.com/perl/critiques/index.html.
180
181 The incontestably definitive reference book on Perl, written by the
182 creator of Perl and his apostles, is now in its second edition and
183 fourth printing.
184
185     Programming Perl (the "Camel Book"):
186         Authors: Larry Wall, Tom Christiansen, and Randal Schwartz
187         ISBN 1-56592-149-6      (English)
188         ISBN 4-89052-384-7      (Japanese)
189         (French, German, and Italian translations also available)
190
191 Note that O'Reilly books are color-coded: turquoise (some would call
192 it teal) covers indicate perl5 coverage, while magenta (some would
193 call it pink) covers indicate perl4 only.  Check the cover color
194 before you buy!
195
196 If you're already a hard-core systems programmer, then the Camel Book
197 might suffice for you to learn Perl from.  But if you're not, check
198 out I<Learning Perl> by Randal and Tom.  The second edition of "Llama
199 Book" has a blue cover, and is updated for the 5.004 release of Perl.
200
201 If you're not an accidental programmer, but a more serious and possibly
202 even degreed computer scientist who doesn't need as much hand-holding as
203 we try to provide in the Llama or its defurred cousin the Gecko, please
204 check out the delightful book, I<Perl: The Programmer's Companion>,
205 written by Nigel Chapman.
206
207 You can order O'Reilly books directly from O'Reilly & Associates,
208 1-800-998-9938.  Local/overseas is 1-707-829-0515.  If you can
209 locate an O'Reilly order form, you can also fax to 1-707-829-0104.
210 See http://www.ora.com/ on the Web.
211
212 What follows is a list of the books that the FAQ authors found personally
213 useful.  Your mileage may (but, we hope, probably won't) vary.
214
215 Recommended books on (or muchly on) Perl are the following.  
216 Those marked with a star may be ordered from O'Reilly.
217
218 =over
219
220 =item References
221
222     *Programming Perl
223         by Larry Wall, Tom Christiansen, and Randal L. Schwartz
224
225     *Perl 5 Desktop Reference
226         By Johan Vromans
227
228 =item Tutorials
229                 
230     *Learning Perl [2nd edition]
231         by Randal L. Schwartz and Tom Christiansen
232
233     *Learning Perl on Win32 Systems
234         by Randal L. Schwartz, Erik Olson, and Tom Christiansen,
235             with foreword by Larry Wall
236
237     Perl: The Programmer's Companion
238         by Nigel Chapman
239
240     Cross-Platform Perl 
241         by Eric F. Johnson
242
243     MacPerl: Power and Ease 
244         by Vicki Brown and Chris Nandor, foreword by Matthias Neeracher
245
246 =item Task-Oriented
247
248     *The Perl Cookbook
249         by Tom Christiansen and Nathan Torkington
250             with foreword by Larry Wall
251
252     Perl5 Interactive Course [2nd edition]
253         by Jon Orwant
254
255     *Advanced Perl Programming 
256         by Sriram Srinivasan
257
258     Effective Perl Programming 
259         by Joseph Hall
260
261 =item Special Topics
262
263     *Mastering Regular Expressions
264         by Jeffrey Friedl
265
266     How to Set up and Maintain a World Wide Web Site [2nd edition]
267         by Lincoln Stein
268
269 =back
270
271 =head2 Perl in Magazines
272
273 The first and only periodical devoted to All Things Perl, I<The
274 Perl Journal> contains tutorials, demonstrations, case studies,
275 announcements, contests, and much more.  TPJ has columns on web
276 development, databases, Win32 Perl, graphical programming, regular
277 expressions, and networking, and sponsors the Obfuscated Perl Contest.
278 It is published quarterly by Jon Orwant.  See http://www.tpj.com/ or
279 send mail to subscriptions@tpj.com.
280
281 Beyond this, magazines that frequently carry high-quality articles
282 on Perl are I<Web Techniques> (see http://www.webtechniques.com/),
283 I<Performance Computing> (http://www.performance-computing.com/), and Usenix's
284 newsletter/magazine to its members, I<login:>, at http://www.usenix.org/.
285 Randal's Web Technique's columns are available on the web at
286 http://www.stonehenge.com/merlyn/WebTechniques/.
287
288 =head2 Perl on the Net: FTP and WWW Access
289
290 To get the best (and possibly cheapest) performance, pick a site from
291 the list below and use it to grab the complete list of mirror sites.
292 From there you can find the quickest site for you.  Remember, the
293 following list is I<not> the complete list of CPAN mirrors.
294
295   http://www.perl.com/CPAN      (redirects to another mirror)
296   http://www.perl.org/CPAN
297   ftp://ftp.funet.fi/pub/languages/perl/CPAN/
298   http://www.cs.ruu.nl/pub/PERL/CPAN/
299   ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
300
301 http:/www.oasis.leo.org/perl/ has, amongst other things, source to
302 versions 1 through 5 of Perl.
303
304 =head2 What mailing lists are there for perl?
305
306 Most of the major modules (tk, CGI, libwww-perl) have their own
307 mailing lists.  Consult the documentation that came with the module for
308 subscription information.  The following are a list of mailing lists
309 related to perl itself.
310
311 If you subscribe to a mailing list, it behooves you to know how to
312 unsubscribe from it.  Strident pleas to the list itself to get you off
313 will not be favorably received.
314
315 =over 4
316
317 =item MacPerl
318
319 There is a mailing list for discussing Macintosh Perl.  Contact
320 "mac-perl-request@iis.ee.ethz.ch".
321
322 Also see Matthias Neeracher's (the creator and maintainer of MacPerl)
323 webpage at http://www.iis.ee.ethz.ch/~neeri/macintosh/perl.html for
324 many links to interesting MacPerl sites, and the applications/MPW
325 tools, precompiled.
326
327 =item Perl5-Porters
328
329 The core development team have a mailing list for discussing fixes and
330 changes to the language.  Send mail to
331 "perl5-porters-request@perl.org" with help in the body of the message
332 for information on subscribing.
333
334 =item NTPerl
335
336 This list is used to discuss issues involving Win32 Perl 5 (Windows NT
337 and Win95). Subscribe by mailing ListManager@ActiveWare.com with the
338 message body:
339
340     subscribe Perl-Win32-Users
341
342 The list software, also written in perl, will automatically determine
343 your address, and subscribe you automatically.  To unsubscribe, mail
344 the following in the message body to the same address like so:
345
346     unsubscribe Perl-Win32-Users
347
348 You can also check http://www.activeware.com/ and select "Mailing Lists"
349 to join or leave this list.
350
351 =item Perl-Packrats
352
353 Discussion related to archiving of perl materials, particularly the
354 Comprehensive Perl Archive Network (CPAN). Subscribe by emailing
355 majordomo@cis.ufl.edu:
356
357     subscribe perl-packrats
358
359 The list software, also written in perl, will automatically determine
360 your address, and subscribe you automatically.  To unsubscribe, simple
361 prepend the same command with an "un", and mail to the same address
362 like so:
363
364     unsubscribe perl-packrats
365
366 =back
367
368 =head2 Archives of comp.lang.perl.misc
369
370 Have you tried Deja News or Alta Vista?
371
372 ftp.cis.ufl.edu:/pub/perl/comp.lang.perl.*/monthly has an almost
373 complete collection dating back to 12/89 (missing 08/91 through
374 12/93).  They are kept as one large file for each month.
375
376 You'll probably want more a sophisticated query and retrieval mechanism
377 than a file listing, preferably one that allows you to retrieve
378 articles using a fast-access indices, keyed on at least author, date,
379 subject, thread (as in "trn") and probably keywords.  The best
380 solution the FAQ authors know of is the MH pick command, but it is
381 very slow to select on 18000 articles.
382
383 If you have, or know where can be found, the missing sections, please
384 let perlfaq-suggestions@perl.com know.
385
386 =head2 Perl Training
387
388 While some large training companies offer their own courses on
389 Perl, you may prefer to contact individuals near and dear to
390 the heart of Perl development.  Two well-known members of the
391 Perl development team head companies which offer such things
392 are Tom Christiansen <perl-classes@perl.com> and Randal Schwartz
393 <perl-training-info@stonehenge.com>, plus their respective minions,
394 who offer a variety of professional tutorials and seminars on Perl.
395 These courses include large public seminars, private corporate training,
396 and fly-ins to Colorado and Oregon.  Contact Tom or Randal for details,
397 or see http://www.perl.com/perl/info/training.html on the web.
398
399 =head2 Where can I buy a commercial version of Perl?
400
401 In a sense, Perl already I<is> commercial software: It has a licence
402 that you can grab and carefully read to your manager. It is
403 distributed in releases and comes in well-defined packages. There is a
404 very large user community and an extensive literature.  The
405 comp.lang.perl.* newsgroups and several of the mailing lists provide
406 free answers to your questions in near real-time.  Perl has
407 traditionally been supported by Larry, dozens of software designers
408 and developers, and thousands of programmers, all working for free
409 to create a useful thing to make life better for everyone.
410
411 However, these answers may not suffice for managers who require a
412 purchase order from a company whom they can sue should anything go
413 wrong.  Or maybe they need very serious hand-holding and contractual
414 obligations.  Shrink-wrapped CDs with perl on them are available from
415 several sources if that will help.
416
417 Or you can purchase a real support contract.  Although Cygnus historically
418 provided this service, they no longer sell support contracts for Perl.
419 Instead, the Paul Ingram Group will be taking up the slack through The
420 Perl Clinic.  The following is a commercial from them:
421
422 "Do you need professional support for Perl and/or Oraperl?  Do you need
423 a support contract with defined levels of service?  Do you want to pay
424 only for what you need?
425
426 "The Paul Ingram Group has provided quality software development and
427 support services to some of the world's largest corporations for ten
428 years.  We are now offering the same quality support services for Perl
429 at The Perl Clinic.  This service is led by Tim Bunce, an active perl
430 porter since 1994 and well known as the author and maintainer of the
431 DBI, DBD::Oracle, and Oraperl modules and author/co-maintainer of The
432 Perl 5 Module List.  We also offer Oracle users support for Perl5
433 Oraperl and related modules (which Oracle is planning to ship as part
434 of Oracle Web Server 3).  20% of the profit from our Perl support work
435 will be donated to The Perl Institute."
436
437 For more information, contact the The Perl Clinic:
438
439     Tel:    +44 1483 424424
440     Fax:    +44 1483 419419
441     Web:    http://www.perl.co.uk/
442     Email:  perl-support-info@perl.co.uk or Tim.Bunce@ig.co.uk
443
444 =head2 Where do I send bug reports?
445
446 If you are reporting a bug in the perl interpreter or the modules
447 shipped with perl, use the I<perlbug> program in the perl distribution or
448 mail your report to perlbug@perl.com.
449
450 If you are posting a bug with a non-standard port (see the answer to
451 "What platforms is Perl available for?"), a binary distribution, or a
452 non-standard module (such as Tk, CGI, etc), then please see the
453 documentation that came with it to determine the correct place to post
454 bugs.
455
456 Read the perlbug(1) man page (perl5.004 or later) for more information.
457
458 =head2 What is perl.com?  perl.org?  The Perl Institute?
459
460 The perl.com domain is Tom Christiansen's domain.  He created it as a
461 public service long before perl.org came about.  Despite the name, it's a
462 pretty non-commercial site meant to be a clearinghouse for information
463 about all things Perlian, accepting no paid advertisements, bouncy
464 happy gifs, or silly java applets on its pages.  The Perl Home Page at
465 http://www.perl.com/ is currently hosted on a T3 line courtesy of Songline
466 Systems, a software-oriented subsidiary of O'Reilly and Associates.
467
468 perl.org is the official vehicle for The Perl Institute.  The motto of
469 TPI is "helping people help Perl help people" (or something like
470 that).  It's a non-profit organization supporting development,
471 documentation, and dissemination of perl.  Current directors of TPI
472 include Larry Wall, Tom Christiansen, and Randal Schwartz, whom you
473 may have heard of somewhere else around here.
474
475 =head2 How do I learn about object-oriented Perl programming?
476
477 L<perltoot> (distributed with 5.004 or later) is a good place to start.
478 Also, L<perlobj>, L<perlref>, and L<perlmod> are useful references,
479 while L<perlbot> has some excellent tips and tricks.
480
481 =head1 AUTHOR AND COPYRIGHT
482
483 Copyright (c) 1997, 1998 Tom Christiansen and Nathan Torkington.
484 All rights reserved.
485
486 When included as an integrated part of the Standard Distribution
487 of Perl or of its documentation (printed or otherwise), this works is
488 covered under Perl's Artistic Licence.  For separate distributions of
489 all or part of this FAQ outside of that, see L<perlfaq>.
490
491 Irrespective of its distribution, all code examples here are public
492 domain.  You are permitted and encouraged to use this code and any
493 derivatives thereof in your own programs for fun or for profit as you
494 see fit.  A simple comment in the code giving credit to the FAQ would
495 be courteous but is not required.