fix a cast warning in perly.c
[p5sagit/p5-mst-13.2.git] / pod / perlfaq2.pod
1 =head1 NAME
2
3 perlfaq2 - Obtaining and Learning about Perl ($Revision: 7996 $)
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
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
15 can find this at http://www.cpan.org/src/latest.tar.gz , which
16 is in a standard Internet format (a gzipped archive in POSIX tar format).
17
18 Perl builds and runs on a bewildering number of platforms.  Virtually
19 all known and current Unix derivatives are supported (perl's native
20 platform), as are other systems like VMS, DOS, OS/2, Windows,
21 QNX, BeOS, OS X, MPE/iX and the Amiga.
22
23 Binary distributions for some proprietary platforms, including
24 Apple systems, can be found http://www.cpan.org/ports/ directory.
25 Because these are not part of the standard distribution, they may
26 and in fact do differ from the base perl port in a variety of ways.
27 You'll have to check their respective release notes to see just
28 what the differences are.  These differences can be either positive
29 (e.g. extensions for the features of the particular platform that
30 are not supported in the source release of perl) or negative (e.g.
31 might be based upon a less current source release of perl).
32
33 =head2 How can I get a binary version of perl?
34
35 For Windows, ActiveState provides a pre-built Perl for free:
36
37         http://www.activestate.com/
38
39 Sunfreeware.com provides binaries for many utilities, including
40 Perl, for Solaris on both Intel and SPARC hardware:
41
42         http://www.sunfreeware.com/
43
44 If you don't have a C compiler because your vendor for whatever
45 reasons did not include one with your system, the best thing to do is
46 grab a binary version of gcc from the net and use that to compile perl
47 with.  CPAN only has binaries for systems that are terribly hard to
48 get free compilers for, not for Unix systems.
49
50 Some URLs that might help you are:
51
52         http://www.cpan.org/ports/
53         http://www.perl.com/pub/language/info/software.html
54
55 Someone looking for a perl for Win16 might look to Laszlo Molnar's
56 djgpp port in http://www.cpan.org/ports/#msdos , which comes with
57 clear installation instructions.  A simple installation guide for
58 MS-DOS using Ilya Zakharevich's OS/2 port is available at
59 http://www.cs.ruu.nl/%7Epiet/perl5dos.html
60 and similarly for Windows 3.1 at http://www.cs.ruu.nl/%7Epiet/perlwin3.html .
61
62 =head2 I don't have a C compiler. How can I build my own Perl interpreter?
63
64 Since you don't have a C compiler, you're doomed and your vendor
65 should be sacrificed to the Sun gods.  But that doesn't help you.
66
67 What you need to do is get a binary version of gcc for your system
68 first.  Consult the Usenet FAQs for your operating system for
69 information on where to get such a binary version.
70
71 =head2 I copied the perl binary from one machine to another, but scripts don't work.
72
73 That's probably because you forgot libraries, or library paths differ.
74 You really should build the whole distribution on the machine it will
75 eventually live on, and then type C<make install>.  Most other
76 approaches are doomed to failure.
77
78 One simple way to check that things are in the right place is to print out
79 the hard-coded @INC that perl looks through for libraries:
80
81     % perl -le 'print for @INC'
82
83 If this command lists any paths that don't exist on your system, then you
84 may need to move the appropriate libraries to these locations, or create
85 symbolic links, aliases, or shortcuts appropriately.  @INC is also printed as
86 part of the output of
87
88     % perl -V
89
90 You might also want to check out
91 L<perlfaq8/"How do I keep my own module/library directory?">.
92
93 =head2 I grabbed the sources and tried to compile but gdbm/dynamic loading/malloc/linking/... failed.  How do I make it work?
94
95 Read the F<INSTALL> file, which is part of the source distribution.
96 It describes in detail how to cope with most idiosyncrasies that the
97 Configure script can't work around for any given system or
98 architecture.
99
100 =head2 What modules and extensions are available for Perl?  What is CPAN?  What does CPAN/src/... mean?
101
102 CPAN stands for Comprehensive Perl Archive Network, a multi-gigabyte
103 archive replicated on hundreds of machines all over the world. CPAN
104 contains source code, non-native ports, documentation, scripts, and
105 many third-party modules and extensions, designed for everything from
106 commercial database interfaces to keyboard/screen control to web
107 walking and CGI scripts. The master web site for CPAN is
108 http://www.cpan.org/ and there is the CPAN Multiplexer at
109 http://www.cpan.org/CPAN.html which will choose a mirror near you via
110 DNS.  See http://www.perl.com/CPAN (without a slash at the end) for
111 how this process works. Also, http://mirror.cpan.org/ has a nice
112 interface to the http://www.cpan.org/MIRRORED.BY mirror directory.
113
114 See the CPAN FAQ at http://www.cpan.org/misc/cpan-faq.html for answers
115 to the most frequently asked questions about CPAN including how to
116 become a mirror.
117
118 CPAN/path/... is a naming convention for files available on CPAN
119 sites.  CPAN indicates the base directory of a CPAN mirror, and the
120 rest of the path is the path from that directory to the file. For
121 instance, if you're using ftp://ftp.funet.fi/pub/languages/perl/CPAN
122 as your CPAN site, the file CPAN/misc/japh is downloadable as
123 ftp://ftp.funet.fi/pub/languages/perl/CPAN/misc/japh .
124
125 Considering that, as of 2006, there are over ten thousand existing
126 modules in the archive, one probably exists to do nearly anything you
127 can think of. Current categories under CPAN/modules/by-category/
128 include Perl core modules; development support; operating system
129 interfaces; networking, devices, and interprocess communication; data
130 type utilities; database interfaces; user interfaces; interfaces to
131 other languages; filenames, file systems, and file locking;
132 internationalization and locale; world wide web support; server and
133 daemon utilities; archiving and compression; image manipulation; mail
134 and news; control flow utilities; filehandle and I/O; Microsoft
135 Windows modules; and miscellaneous modules.
136
137 See http://www.cpan.org/modules/00modlist.long.html or
138 http://search.cpan.org/ for a more complete list of modules by
139 category.
140
141 CPAN is a free service and is not affiliated with O'Reilly Media.
142
143 =head2 Is there an ISO or ANSI certified version of Perl?
144
145 Certainly not.  Larry expects that he'll be certified before Perl is.
146
147 =head2 Where can I get information on Perl?
148
149 The complete Perl documentation is available with the Perl distribution.
150 If you have Perl installed locally, you probably have the documentation
151 installed as well: type C<man perl> if you're on a system resembling Unix.
152 This will lead you to other important man pages, including how to set your
153 $MANPATH.  If you're not on a Unix system, access to the documentation
154 will be different; for example, documentation might only be in HTML format.  All
155 proper perl installations have fully-accessible documentation.
156
157 You might also try C<perldoc perl> in case your system doesn't
158 have a proper man command, or it's been misinstalled.  If that doesn't
159 work, try looking in /usr/local/lib/perl5/pod for documentation.
160
161 If all else fails, consult http://perldoc.perl.org/ which has the
162 complete documentation in HTML and PDF format.
163
164 Many good books have been written about Perl--see the section later in
165 L<perlfaq2> for more details.
166
167 Tutorial documents are included in current or upcoming Perl releases
168 include L<perltoot> for objects or L<perlboot> for a beginner's
169 approach to objects, L<perlopentut> for file opening semantics,
170 L<perlreftut> for managing references, L<perlretut> for regular
171 expressions, L<perlthrtut> for threads, L<perldebtut> for debugging,
172 and L<perlxstut> for linking C and Perl together.  There may be more
173 by the time you read this.  These URLs might also be useful:
174
175     http://perldoc.perl.org/
176     http://bookmarks.cpan.org/search.cgi?cat=Training%2FTutorials
177
178 =head2 What are the Perl newsgroups on Usenet?  Where do I post questions?
179
180 Several groups devoted to the Perl language are on Usenet:
181
182     comp.lang.perl.announce             Moderated announcement group
183     comp.lang.perl.misc                 High traffic general Perl discussion
184     comp.lang.perl.moderated        Moderated discussion group
185     comp.lang.perl.modules              Use and development of Perl modules
186     comp.lang.perl.tk                   Using Tk (and X) from Perl
187
188     comp.infosystems.www.authoring.cgi  Writing CGI scripts for the Web.
189
190 Some years ago, comp.lang.perl was divided into those groups, and
191 comp.lang.perl itself officially removed.  While that group may still
192 be found on some news servers, it is unwise to use it, because
193 postings there will not appear on news servers which honour the
194 official list of group names.  Use comp.lang.perl.misc for topics
195 which do not have a more-appropriate specific group.
196
197 There is also a Usenet gateway to Perl mailing lists sponsored by
198 perl.org at nntp://nntp.perl.org , a web interface to the same lists
199 at http://nntp.perl.org/group/ and these lists are also available
200 under the C<perl.*> hierarchy at http://groups.google.com . Other
201 groups are listed at http://lists.perl.org/ ( also known as
202 http://lists.cpan.org/ ).
203
204 A nice place to ask questions is the PerlMonks site,
205 http://www.perlmonks.org/ , or the Perl Beginners mailing list
206 http://lists.perl.org/showlist.cgi?name=beginners .
207
208 Note that none of the above are supposed to write your code for you:
209 asking questions about particular problems or general advice is fine,
210 but asking someone to write your code for free is not very cool.
211
212 =head2 Where should I post source code?
213
214 You should post source code to whichever group is most appropriate, but
215 feel free to cross-post to comp.lang.perl.misc.  If you want to cross-post
216 to alt.sources, please make sure it follows their posting standards,
217 including setting the Followup-To header line to NOT include alt.sources;
218 see their FAQ ( http://www.faqs.org/faqs/alt-sources-intro/ ) for details.
219
220 If you're just looking for software, first use Google
221 ( http://www.google.com ), Google's usenet search interface
222 ( http://groups.google.com ),  and CPAN Search ( http://search.cpan.org ).
223 This is faster and more productive than just posting a request.
224
225 =head2 Perl Books
226
227 A number of books on Perl and/or CGI programming are available.  A few
228 of these are good, some are OK, but many aren't worth your money.
229 There is a list of these books, some with extensive reviews, at
230 http://books.perl.org/ . If you don't see your book listed here, you
231 can write to perlfaq-workers@perl.org .
232
233 The incontestably definitive reference book on Perl, written by
234 the creator of Perl, is Programming Perl:
235
236         Programming Perl (the "Camel Book"):
237         by Larry Wall, Tom Christiansen, and Jon Orwant
238         ISBN 0-596-00027-8  [3rd edition July 2000]
239         http://www.oreilly.com/catalog/pperl3/
240         (English, translations to several languages are also available)
241
242 The companion volume to the Camel containing thousands
243 of real-world examples, mini-tutorials, and complete programs is:
244
245         The Perl Cookbook (the "Ram Book"):
246         by Tom Christiansen and Nathan Torkington,
247             with Foreword by Larry Wall
248         ISBN 0-596-00313-7 [2nd Edition August 2003]
249         http://www.oreilly.com/catalog/perlckbk2/
250
251 If you're already a seasoned programmer, then the Camel Book might
252 suffice for you to learn Perl.  If you're not, check out the
253 Llama book:
254
255         Learning Perl
256         by Randal L. Schwartz, Tom Phoenix, and brian d foy
257         ISBN 0-596-10105-8 [4th edition July 2005]
258         http://www.oreilly.com/catalog/learnperl4/
259
260 And for more advanced information on writing larger programs,
261 presented in the same style as the Llama book, continue your education
262 with the Alpaca book:
263
264         Intermediate Perl (the "Alpaca Book")
265         by Randal L. Schwartz and brian d foy, with Tom Phoenix (foreword by Damian Conway)
266         ISBN 0-596-10206-2 [1st edition March 2006]
267         http://www.oreilly.com/catalog/lrnperlorm/
268
269 Addison-Wesley ( http://www.awlonline.com/ ) and Manning
270 ( http://www.manning.com/ ) are also publishers of some fine Perl books
271 such as I<Object Oriented Programming with Perl> by Damian Conway and
272 I<Network Programming with Perl> by Lincoln Stein.
273
274 An excellent technical book discounter is Bookpool at
275 http://www.bookpool.com/ where a 30% discount or more is not unusual.
276
277 What follows is a list of the books that the FAQ authors found personally
278 useful.  Your mileage may (but, we hope, probably won't) vary.
279
280 Recommended books on (or mostly on) Perl follow.
281
282 =over 4
283
284 =item References
285
286         Programming Perl
287         by Larry Wall, Tom Christiansen, and Jon Orwant
288         ISBN 0-596-00027-8 [3rd edition July 2000]
289         http://www.oreilly.com/catalog/pperl3/
290
291         Perl 5 Pocket Reference
292         by Johan Vromans
293         ISBN 0-596-00032-4 [3rd edition May 2000]
294         http://www.oreilly.com/catalog/perlpr3/
295
296 =item Tutorials
297
298         Beginning Perl
299         by James Lee
300         ISBN 1-59059-391-X [2nd edition August 2004]
301         http://apress.com/book/bookDisplay.html?bID=344
302
303         Elements of Programming with Perl
304         by Andrew L. Johnson
305         ISBN 1-884777-80-5 [1st edition October 1999]
306         http://www.manning.com/johnson/
307
308         Learning Perl
309         by Randal L. Schwartz, Tom Phoenix, and brian d foy
310         ISBN 0-596-10105-8 [4th edition July 2005]
311         http://www.oreilly.com/catalog/learnperl4/
312
313         Intermediate Perl (the "Alpaca Book")
314         by Randal L. Schwartz and brian d foy, with Tom Phoenix (foreword by Damian Conway)
315         ISBN 0-596-10206-2 [1st edition March 2006]
316         http://www.oreilly.com/catalog/lrnperlorm/
317
318 =item Task-Oriented
319
320         Writing Perl Modules for CPAN
321         by Sam Tregar
322         ISBN 1-59059-018-X [1st edition Aug 2002]
323         http://apress.com/book/bookDisplay.html?bID=14
324
325         The Perl Cookbook
326         by Tom Christiansen and Nathan Torkington
327             with foreword by Larry Wall
328         ISBN 1-56592-243-3 [1st edition August 1998]
329         http://www.oreilly.com/catalog/cookbook/
330
331         Effective Perl Programming
332         by Joseph Hall
333         ISBN 0-201-41975-0 [1st edition 1998]
334         http://www.awl.com/
335
336         Real World SQL Server Administration with Perl
337         by Linchi Shea
338         ISBN 1-59059-097-X [1st edition July 2003]
339         http://apress.com/book/bookDisplay.html?bID=171
340
341 =item Special Topics
342
343         Perl Best Practices
344         by Damian Conway
345         ISBN: 0-596-00173-8 [1st edition July 2005]
346         http://www.oreilly.com/catalog/perlbp/
347
348         Higher Order Perl
349         by Mark-Jason Dominus
350         ISBN: 1558607013 [1st edition March 2005]
351         http://hop.perl.plover.com/
352
353         Perl 6 Now: The Core Ideas Illustrated with Perl 5
354         by Scott Walters
355         ISBN 1-59059-395-2 [1st edition December 2004]
356         http://apress.com/book/bookDisplay.html?bID=355
357
358         Mastering Regular Expressions
359         by Jeffrey E. F. Friedl
360         ISBN 0-596-00289-0 [2nd edition July 2002]
361         http://www.oreilly.com/catalog/regex2/
362
363         Network Programming with Perl
364         by Lincoln Stein
365         ISBN 0-201-61571-1 [1st edition 2001]
366         http://www.awlonline.com/
367
368         Object Oriented Perl
369         Damian Conway
370             with foreword by Randal L. Schwartz
371         ISBN 1-884777-79-1 [1st edition August 1999]
372         http://www.manning.com/conway/
373
374         Data Munging with Perl
375         Dave Cross
376         ISBN 1-930110-00-6 [1st edition 2001]
377         http://www.manning.com/cross
378
379         Mastering Perl/Tk
380         by Steve Lidie and Nancy Walsh
381         ISBN 1-56592-716-8 [1st edition January 2002]
382         http://www.oreilly.com/catalog/mastperltk/
383
384         Extending and Embedding Perl
385         by Tim Jenness and Simon Cozens
386         ISBN 1-930110-82-0 [1st edition August 2002]
387         http://www.manning.com/jenness
388
389         Perl Debugger Pocket Reference
390         by Richard Foley
391         ISBN 0-596-00503-2 [1st edition January 2004]
392         http://www.oreilly.com/catalog/perldebugpr/
393
394 =back
395
396 =head2 Which magazines have Perl content?
397
398 I<The Perl Review> ( http://www.theperlreview.com ) focuses on Perl
399 almost completely (although it sometimes sneaks in an article about
400 another language).
401
402 Magazines that frequently carry quality articles on Perl include I<The
403 Perl Review> ( http://www.theperlreview.com ), I<Unix Review> (
404 http://www.unixreview.com/ ), I<Linux Magazine> (
405 http://www.linuxmagazine.com/ ), and Usenix's newsletter/magazine to
406 its members, I<login:> ( http://www.usenix.org/ )
407
408 The Perl columns of Randal L. Schwartz are available on the web at
409 http://www.stonehenge.com/merlyn/WebTechniques/ ,
410 http://www.stonehenge.com/merlyn/UnixReview/ , and
411 http://www.stonehenge.com/merlyn/LinuxMag/ .
412
413 The first (and for a long time, only) periodical devoted to All Things
414 Perl, I<The Perl Journal> contains tutorials, demonstrations, case
415 studies, announcements, contests, and much more.  I<TPJ> has columns
416 on web development, databases, Win32 Perl, graphical programming,
417 regular expressions, and networking, and sponsors the Obfuscated Perl
418 Contest and the Perl Poetry Contests.  Beginning in November 2002, TPJ
419 moved to a reader-supported monthly e-zine format in which subscribers
420 can download issues as PDF documents. In 2006, TPJ merged with Dr.
421 Dobbs Journal (online edition). To read old TPJ articles, see
422 http://www.ddj.com/ .
423
424 =head2 What mailing lists are there for Perl?
425
426 Most of the major modules (Tk, CGI, libwww-perl) have their own
427 mailing lists.  Consult the documentation that came with the module for
428 subscription information.
429
430 A comprehensive list of Perl related mailing lists can be found at:
431
432         http://lists.perl.org/
433
434 =head2 Where are the archives for comp.lang.perl.misc?
435
436 The Google search engine now carries archived and searchable newsgroup
437 content.
438
439 http://groups.google.com/groups?group=comp.lang.perl.misc
440
441 If you have a question, you can be sure someone has already asked the
442 same question at some point on c.l.p.m. It requires some time and patience
443 to sift through all the content but often you will find the answer you
444 seek.
445
446 =head2 Where can I buy a commercial version of perl?
447
448 In a real sense, perl already I<is> commercial software: it has a license
449 that you can grab and carefully read to your manager. It is distributed
450 in releases and comes in well-defined packages. There is a very large
451 user community and an extensive literature.  The comp.lang.perl.*
452 newsgroups and several of the mailing lists provide free answers to your
453 questions in near real-time.  Perl has traditionally been supported by
454 Larry, scores of software designers and developers, and myriad
455 programmers, all working for free to create a useful thing to make life
456 better for everyone.
457
458 However, these answers may not suffice for managers who require a
459 purchase order from a company whom they can sue should anything go awry.
460 Or maybe they need very serious hand-holding and contractual obligations.
461 Shrink-wrapped CDs with perl on them are available from several sources if
462 that will help.  For example, many Perl books include a distribution of perl,
463 as do the O'Reilly Perl Resource Kits (in both the Unix flavor
464 and in the proprietary Microsoft flavor); the free Unix distributions
465 also all come with perl.
466
467 =head2 Where do I send bug reports?
468
469 If you are reporting a bug in the perl interpreter or the modules
470 shipped with Perl, use the I<perlbug> program in the Perl distribution or
471 mail your report to perlbug@perl.org or at http://rt.perl.org/perlbug/ .
472
473 For Perl modules, you can submit bug reports to the Request Tracker set
474 up at http://rt.cpan.org .
475
476 If you are posting a bug with a non-standard port (see the answer to
477 "What platforms is perl available for?"), a binary distribution, or a
478 non-standard module (such as Tk, CGI, etc), then please see the
479 documentation that came with it to determine the correct place to post
480 bugs.
481
482 Read the perlbug(1) man page (perl5.004 or later) for more information.
483
484 =head2 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?
485
486 Perl.com at http://www.perl.com/ is part of the O'Reilly Network, a
487 subsidiary of O'Reilly Media.
488
489 The Perl Foundation is an advocacy organization for the Perl language
490 which maintains the web site http://www.perl.org/ as a general
491 advocacy site for the Perl language. It uses the domain to provide
492 general support services to the Perl community, including the hosting
493 of mailing lists, web sites, and other services.  The web site
494 http://www.perl.org/ is a general advocacy site for the Perl language,
495 and there are many other sub-domains for special topics, such as
496
497         http://learn.perl.org/
498         http://use.perl.org/
499         http://jobs.perl.org/
500         http://lists.perl.org/
501
502 Perl Mongers uses the pm.org domain for services related to Perl user
503 groups, including the hosting of mailing lists and web sites.  See the
504 Perl user group web site at http://www.pm.org/ for more information about
505 joining, starting, or requesting services for a Perl user group.
506
507 http://www.cpan.org/ is the Comprehensive Perl Archive Network,
508 a replicated worldwide repository of Perl software, see
509 the I<What is CPAN?> question earlier in this document.
510
511 =head1 REVISION
512
513 Revision: $Revision: 7996 $
514
515 Date: $Date: 2006-11-01 09:24:38 +0100 (mer, 01 nov 2006) $
516
517 See L<perlfaq> for source control details and availability.
518
519 =head1 AUTHOR AND COPYRIGHT
520
521 Copyright (c) 1997-2006 Tom Christiansen, Nathan Torkington, and
522 other authors as noted. All rights reserved.
523
524 This documentation is free; you can redistribute it and/or modify it
525 under the same terms as Perl itself.
526
527 Irrespective of its distribution, all code examples here are in the public
528 domain.  You are permitted and encouraged to use this code and any
529 derivatives thereof in your own programs for fun or for profit as you
530 see fit.  A simple comment in the code giving credit to the FAQ would
531 be courteous but is not required.