perlfaq1.pod
来自「MSYS在windows下模拟了一个类unix的终端」· POD 代码 · 共 329 行 · 第 1/2 页
POD
329 行
=head1 NAMEperlfaq1 - General Questions About Perl ($Revision: 1.23 $, $Date: 1999/05/23 16:08:30 $)=head1 DESCRIPTIONThis section of the FAQ answers very general, high-level questionsabout Perl.=head2 What is Perl?Perl is a high-level programming language with an eclectic heritagewritten by Larry Wall and a cast of thousands. It derives from theubiquitous C programming language and to a lesser extent from sed,awk, the Unix shell, and at least a dozen other tools and languages.Perl's process, file, and text manipulation facilities make itparticularly well-suited for tasks involving quick prototyping, systemutilities, software tools, system management tasks, database access,graphical programming, networking, and world wide web programming.These strengths make it especially popular with system administratorsand CGI script authors, but mathematicians, geneticists, journalists,and even managers also use Perl. Maybe you should, too.=head2 Who supports Perl? Who develops it? Why is it free?The original culture of the pre-populist Internet and the deeply-heldbeliefs of Perl's author, Larry Wall, gave rise to the free and opendistribution policy of perl. Perl is supported by its users. Thecore, the standard Perl library, the optional modules, and thedocumentation you're reading now were all written by volunteers. Seethe personal note at the end of the README file in the perl sourcedistribution for more details. See L<perlhist> (new as of 5.005)for Perl's milestone releases.In particular, the core development team (known as the Perl Porters)are a rag-tag band of highly altruistic individuals committedto producing better software for free than you could hope topurchase for money. You may snoop on pending developments vianntp://news.perl.com/perl.porters-gw/ and the Deja archive athttp://www.deja.com/ using the perl.porters-gw newsgroup, or you cansubscribe to the mailing list by sending perl5-porters-request@perl.orga subscription request.While the GNU project includes Perl in its distributions, there's nosuch thing as "GNU Perl". Perl is not produced nor maintained by theFree Software Foundation. Perl's licensing terms are also more openthan GNU software's tend to be.You can get commercial support of Perl if you wish, although for mostusers the informal support will more than suffice. See the answer to"Where can I buy a commercial version of perl?" for more information.=head2 Which version of Perl should I use?You should definitely use version 5. Version 4 is old, limited, andno longer maintained; its last patch (4.036) was in 1992, long ago andfar away. Sure, it's stable, but so is anything that's dead; in fact,perl4 had been called a dead, flea-bitten camel carcass. The most recentproduction release is 5.6 (although 5.005_03 is still supported).The most cutting-edge development release is 5.7. Further referencesto the Perl language in this document refer to the production releaseunless otherwise specified. There may be one or more official bug fixesby the time you read this, and also perhaps some experimental versionson the way to the next release. All releases prior to 5.004 were subjectto buffer overruns, a grave security issue.=head2 What are perl4 and perl5?Perl4 and perl5 are informal names for different versions of the Perlprogramming language. It's easier to say "perl5" than it is to say"the 5(.004) release of Perl", but some people have interpreted thisto mean there's a language called "perl5", which isn't the case.Perl5 is merely the popular name for the fifth major release (October 1994),while perl4 was the fourth major release (March 1991). There was also aperl1 (in January 1988), a perl2 (June 1988), and a perl3 (October 1989).The 5.0 release is, essentially, a ground-up rewrite of the originalperl source code from releases 1 through 4. It has been modularized,object-oriented, tweaked, trimmed, and optimized until it almost doesn'tlook like the old code. However, the interface is mostly the same, andcompatibility with previous releases is very high. See L<perltrap/"Perl4 to Perl5 Traps">.To avoid the "what language is perl5?" confusion, some people prefer tosimply use "perl" to refer to the latest version of perl and avoid using"perl5" altogether. It's not really that big a deal, though.See L<perlhist> for a history of Perl revisions.=head2 What is perl6?At The Second O'Reilly Open Source Software Convention, Larry Wall announced Perl6 development would begin in earnest. Perl6 was an oftused term for Chip Salzenberg's project to rewrite Perl in C++ namedTopaz. However, Topaz should not be confused with the nisus to rewritePerl while keeping the lessons learned from other software, as well asPerl5, in mind.If you have a desire to help in the crusade to make Perl a better placethen peruse the Perl6 developers page at http://www.perl.org/perl6/ and get involved.The first alpha release is expected by Summer 2001."We're really serious about reinventing everything that needs reinventing."--Larry Wall=head2 How stable is Perl?Production releases, which incorporate bug fixes and new functionality,are widely tested before release. Since the 5.000 release, we haveaveraged only about one production release per year.Larry and the Perl development team occasionally make changes to theinternal core of the language, but all possible efforts are made towardbackward compatibility. While not quite all perl4 scripts run flawlesslyunder perl5, an update to perl should nearly never invalidate a programwritten for an earlier version of perl (barring accidental bug fixesand the rare new keyword).=head2 Is Perl difficult to learn?No, Perl is easy to start learning--and easy to keep learning. It lookslike most programming languages you're likely to have experiencewith, so if you've ever written a C program, an awk script, a shellscript, or even a BASIC program, you're already partway there.Most tasks only require a small subset of the Perl language. One ofthe guiding mottos for Perl development is "there's more than one wayto do it" (TMTOWTDI, sometimes pronounced "tim toady"). Perl'slearning curve is therefore shallow (easy to learn) and long (there'sa whole lot you can do if you really want).Finally, because Perl is frequently (but not always, and certainly not bydefinition) an interpreted language, you can write your programs and testthem without an intermediate compilation step, allowing you to experimentand test/debug quickly and easily. This ease of experimentation flattensthe learning curve even more.Things that make Perl easier to learn: Unix experience, almost any kindof programming experience, an understanding of regular expressions, andthe ability to understand other people's code. If there's something youneed to do, then it's probably already been done, and a working example isusually available for free. Don't forget the new perl modules, either.They're discussed in Part 3 of this FAQ, along with CPAN, which isdiscussed in Part 2.=head2 How does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl?Favorably in some areas, unfavorably in others. Precisely which areasare good and bad is often a personal choice, so asking this questionon Usenet runs a strong risk of starting an unproductive Holy War.Probably the best thing to do is try to write equivalent code to do aset of tasks. These languages have their own newsgroups in which youcan learn about (but hopefully not argue about) them.Some comparison documents can be found at http://language.perl.com/versus/if you really can't stop yourself.=head2 Can I do [task] in Perl?Perl is flexible and extensible enough for you to use on virtually anytask, from one-line file-processing tasks to large, elaborate systems.For many people, Perl serves as a great replacement for shell scripting.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?