1=head1 NAME 2 3perlfaq1 - General Questions About Perl 4 5=head1 VERSION 6 7version 5.20240218 8 9=head1 DESCRIPTION 10 11This section of the FAQ answers very general, high-level questions 12about Perl. 13 14=head2 What is Perl? 15 16Perl is a high-level programming language with an eclectic heritage 17written by Larry Wall and a cast of thousands. 18 19Perl's process, file, and text manipulation facilities make it 20particularly well-suited for tasks involving quick prototyping, system 21utilities, software tools, system management tasks, database access, 22graphical programming, networking, and web programming. 23 24Perl derives from the ubiquitous C programming language and to a 25lesser extent from sed, awk, the Unix shell, and many other tools 26and languages. 27 28These strengths make it especially popular with web developers 29and system administrators. Mathematicians, geneticists, journalists, 30managers and many other people also use Perl. 31 32=head2 Who supports Perl? Who develops it? Why is it free? 33 34The original culture of the pre-populist Internet and the deeply-held 35beliefs of Perl's author, Larry Wall, gave rise to the free and open 36distribution policy of Perl. Perl is supported by its users. The 37core, the standard Perl library, the optional modules, and the 38documentation you're reading now were all written by volunteers. 39 40The core development team (known as the Perl Porters) 41are a group of highly altruistic individuals committed to 42producing better software for free than you could hope to purchase for 43money. You may snoop on pending developments via the 44L<archives|http://www.nntp.perl.org/group/perl.perl5.porters/> 45or you can subscribe to the mailing list by sending 46perl5-porters-subscribe@perl.org a subscription request 47(an empty message with no subject is fine). 48 49While the GNU project includes Perl in its distributions, there's no 50such thing as "GNU Perl". Perl is not produced nor maintained by the 51Free Software Foundation. Perl's licensing terms are also more open 52than GNU software's tend to be. 53 54You can get commercial support of Perl if you wish, although for most 55users the informal support will more than suffice. See the answer to 56"Where can I buy a commercial version of Perl?" for more information. 57 58=head2 Which version of Perl should I use? 59 60(contributed by brian d foy with updates from others) 61 62There is often a matter of opinion and taste, and there isn't any one 63answer that fits everyone. In general, you want to use either the current 64stable release, or the stable release immediately prior to that one. 65 66Beyond that, you have to consider several things and decide which is best 67for you. 68 69=over 4 70 71=item * 72 73If things aren't broken, upgrading perl may break them (or at least issue 74new warnings). 75 76=item * 77 78The latest versions of perl have more bug fixes. 79 80=item * 81 82The latest versions of perl may contain performance improvements and 83features not present in older versions. There have been many changes 84in perl since perl5 was first introduced. 85 86=item * 87 88The Perl community is geared toward supporting the most recent releases, 89so you'll have an easier time finding help for those. 90 91=item * 92 93Older versions of perl may have security vulnerabilities, some of which 94are serious (see L<perlsec> and search 95L<CVEs|https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=Perl> for more 96information). 97 98=item * 99 100The latest versions are probably the least deployed and widely tested, so 101you may want to wait a few months after their release and see what 102problems others have if you are risk averse. 103 104=item * 105 106The immediate, in addition to the current stable release, the previous 107stable release is maintained. See 108L<perlpolicy/"MAINTENANCE AND SUPPORT"> for more information. 109 110=item * 111 112There are really two tracks of perl development: a maintenance version 113and an experimental version. The maintenance versions are stable, and 114have an even number as the minor release (i.e. perl5.24.x, where 24 is the 115minor release). The experimental versions may include features that 116don't make it into the stable versions, and have an odd number as the 117minor release (i.e. perl5.25.x, where 25 is the minor release). 118 119=item * 120 121You can consult L<releases|http://dev.perl.org/perl5> to determine the 122current stable release of Perl. 123 124=back 125 126=head2 What is Raku (Perl 6)? 127 128Raku (formerly known as Perl 6) was I<originally> described as the community's 129rewrite of Perl, however as the language evolved, it became clear that it is 130a separate language, but in the same language family as Perl. 131 132Raku is not intended primarily as a replacement for Perl, but as its 133own thing - and libraries exist to allow you to call Perl code from Raku 134programs and vice versa. 135 136Contrary to popular belief, Raku and Perl peacefully coexist with one 137another. Raku has proven to be a fascinating source of ideas for those 138using Perl (the L<Moose> object system is a well-known example). There is 139overlap in the communities, and this overlap fosters the tradition of sharing 140and borrowing that have been instrumental to Perl's success. 141 142For more about Raku see L<https://www.raku.org/>. 143 144"We're really serious about reinventing everything that needs reinventing." 145--Larry Wall 146 147=head2 How stable is Perl? 148 149Production releases, which incorporate bug fixes and new functionality, 150are widely tested before release. Since the 5.000 release, we have 151averaged about one production release per year. 152 153The Perl development team occasionally make changes to the 154internal core of the language, but all possible efforts are made toward 155backward compatibility. 156 157=head2 How often are new versions of Perl released? 158 159Recently, the plan has been to release a new version of Perl roughly every 160April, but getting the release right is more important than sticking rigidly to 161a calendar date, so the release date is somewhat flexible. The historical 162release dates can be viewed at L<http://www.cpan.org/src/README.html>. 163 164Even numbered minor versions (5.14, 5.16, 5.18) are production versions, and 165odd numbered minor versions (5.15, 5.17, 5.19) are development versions. Unless 166you want to try out an experimental feature, you probably never want to install 167a development version of Perl. 168 169The Perl development team are called Perl 5 Porters, and their 170organization is described at L<http://perldoc.perl.org/perlpolicy.html>. 171The organizational rules really just boil down to one: Larry is always 172right, even when he was wrong. 173 174=head2 Is Perl difficult to learn? 175 176No, Perl is easy to start L<learning|http://learn.perl.org/> --and easy to keep learning. It looks 177like most programming languages you're likely to have experience 178with, so if you've ever written a C program, an awk script, a shell 179script, or even a BASIC program, you're already partway there. 180 181Most tasks only require a small subset of the Perl language. One of 182the guiding mottos for Perl development is "there's more than one way 183to do it" (TMTOWTDI, sometimes pronounced "tim toady"). Perl's 184learning curve is therefore shallow (easy to learn) and long (there's 185a whole lot you can do if you really want). 186 187Finally, because Perl is frequently (but not always, and certainly not by 188definition) an interpreted language, you can write your programs and test 189them without an intermediate compilation step, allowing you to experiment 190and test/debug quickly and easily. This ease of experimentation flattens 191the learning curve even more. 192 193Things that make Perl easier to learn: Unix experience, almost any kind 194of programming experience, an understanding of regular expressions, and 195the ability to understand other people's code. If there's something you 196need to do, then it's probably already been done, and a working example is 197usually available for free. Don't forget Perl modules, either. 198They're discussed in Part 3 of this FAQ, along with L<CPAN|http://www.cpan.org/>, which is 199discussed in Part 2. 200 201=head2 How does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl? 202 203Perl can be used for almost any coding problem, even ones which require 204integrating specialist C code for extra speed. As with any tool it can 205be used well or badly. Perl has many strengths, and a few weaknesses, 206precisely which areas are good and bad is often a personal choice. 207 208When choosing a language you should also be influenced by the 209L<resources|http://www.cpan.org/>, L<testing culture|http://www.cpantesters.org/> 210and L<community|http://www.perl.org/community.html> which surrounds it. 211 212For comparisons to a specific language it is often best to create 213a small project in both languages and compare the results, make sure 214to use all the L<resources|http://www.cpan.org/> of each language, 215as a language is far more than just it's syntax. 216 217=head2 Can I do [task] in Perl? 218 219Perl is flexible and extensible enough for you to use on virtually any 220task, from one-line file-processing tasks to large, elaborate systems. 221 222For many people, Perl serves as a great replacement for shell scripting. 223For others, it serves as a convenient, high-level replacement for most of 224what they'd program in low-level languages like C or C++. It's ultimately 225up to you (and possibly your management) which tasks you'll use Perl 226for and which you won't. 227 228If you have a library that provides an API, you can make any component 229of it available as just another Perl function or variable using a Perl 230extension written in C or C++ and dynamically linked into your main 231perl interpreter. You can also go the other direction, and write your 232main program in C or C++, and then link in some Perl code on the fly, 233to create a powerful application. See L<perlembed>. 234 235That said, there will always be small, focused, special-purpose 236languages dedicated to a specific problem domain that are simply more 237convenient for certain kinds of problems. Perl tries to be all things 238to all people, but nothing special to anyone. Examples of specialized 239languages that come to mind include prolog and matlab. 240 241=head2 When shouldn't I program in Perl? 242 243One good reason is when you already have an existing 244application written in another language that's all done (and done 245well), or you have an application language specifically designed for a 246certain task (e.g. prolog, make). 247 248If you find that you need to speed up a specific part of a Perl 249application (not something you often need) you may want to use C, 250but you can access this from your Perl code with L<perlxs>. 251 252=head2 What's the difference between "perl" and "Perl"? 253 254"Perl" is the name of the language. Only the "P" is capitalized. 255The name of the interpreter (the program which runs the Perl script) 256is "perl" with a lowercase "p". 257 258You may or may not choose to follow this usage. But never write "PERL", 259because perl is not an acronym. 260 261=head2 What is a JAPH? 262 263(contributed by brian d foy) 264 265JAPH stands for "Just another Perl hacker,", which Randal Schwartz used 266to sign email and usenet messages starting in the late 1980s. He 267previously used the phrase with many subjects ("Just another x hacker,"), 268so to distinguish his JAPH, he started to write them as Perl programs: 269 270 print "Just another Perl hacker,"; 271 272Other people picked up on this and started to write clever or obfuscated 273programs to produce the same output, spinning things quickly out of 274control while still providing hours of amusement for their creators and 275readers. 276 277CPAN has several JAPH programs at L<http://www.cpan.org/misc/japh>. 278 279=head2 How can I convince others to use Perl? 280 281(contributed by brian d foy) 282 283Appeal to their self interest! If Perl is new (and thus scary) to them, 284find something that Perl can do to solve one of their problems. That 285might mean that Perl either saves them something (time, headaches, money) 286or gives them something (flexibility, power, testability). 287 288In general, the benefit of a language is closely related to the skill of 289the people using that language. If you or your team can be faster, 290better, and stronger through Perl, you'll deliver more value. Remember, 291people often respond better to what they get out of it. If you run 292into resistance, figure out what those people get out of the other 293choice and how Perl might satisfy that requirement. 294 295You don't have to worry about finding or paying for Perl; it's freely 296available and several popular operating systems come with Perl. Community 297support in places such as Perlmonks ( L<http://www.perlmonks.com> ) 298and the various Perl mailing lists ( L<http://lists.perl.org> ) means that 299you can usually get quick answers to your problems. 300 301Finally, keep in mind that Perl might not be the right tool for every 302job. You're a much better advocate if your claims are reasonable and 303grounded in reality. Dogmatically advocating anything tends to make 304people discount your message. Be honest about possible disadvantages 305to your choice of Perl since any choice has trade-offs. 306 307You might find these links useful: 308 309=over 4 310 311=item * L<http://www.perl.org/about.html> 312 313=item * L<http://perltraining.com.au/whyperl.html> 314 315=back 316 317=head1 AUTHOR AND COPYRIGHT 318 319Copyright (c) 1997-2010 Tom Christiansen, Nathan Torkington, and 320other authors as noted. All rights reserved. 321 322This documentation is free; you can redistribute it and/or modify it 323under the same terms as Perl itself. 324 325Irrespective of its distribution, all code examples here are in the public 326domain. You are permitted and encouraged to use this code and any 327derivatives thereof in your own programs for fun or for profit as you 328see fit. A simple comment in the code giving credit to the FAQ would 329be courteous but is not required. 330