Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Perl
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Philosophy === According to Wall, Perl has two slogans. The first is "There's more than one way to do it," commonly known as TMTOWTDI, (pronounced ''Tim Toady''). As proponents of this motto argue, this philosophy makes it easy to write concise statements.<ref>{{cite web |last1=Richardson |first1=Marjorie |title=Larry Wall, the Guru of Perl {{!}} Linux Journal |url=https://www.linuxjournal.com/article/3394 |website=www.linuxjournal.com |publisher=Linux Journal |access-date=16 January 2023}}</ref><ref>{{Cite journal |last=Schwartz |first=Alan |date=December 1998 |title=Tutorial: Perl, a psychologically efficient reformatting language |journal=Behavior Research Methods, Instruments, & Computers |language=en |volume=30 |issue=4 |pages=605β609 |doi=10.3758/BF03209477 |s2cid=61028367 |issn=0743-3808|doi-access=free}}</ref><ref>{{Cite journal |last=Gilbert |first=James G. R. |date=March 2002 |title=How to become a programming tadpole |url=http://www.nature.com/articles/nbt0302-221 |journal=Nature Biotechnology |language=en |volume=20 |issue=3 |pages=221 |doi=10.1038/nbt0302-221 |s2cid=38728402 |issn=1087-0156}}</ref> The second slogan is "Easy things should be easy and hard things should be possible".<ref name="programmingperl2"/> The design of Perl can be understood as a response to three broad trends in the computer industry: falling hardware costs, rising labor costs, and improvements in [[compiler]] technology. Many earlier computer languages, such as [[Fortran]] and C, aimed to make efficient use of expensive computer hardware. In contrast, Perl was designed so that computer programmers could write programs more quickly and easily.<ref>{{Cite web |date=February 13, 2014 |title=The Fall Of Perl, The Web's Most Promising Language |url=https://www.fastcompany.com/3026446/the-fall-of-perl-the-webs-most-promising-language |website=FastCompany |last1=Myhrvold |first1=Conor }}</ref> Perl has many features that ease the task of the programmer at the expense of greater [[CPU]] and memory requirements. These include automatic memory management; [[dynamic typing]]; strings, lists, and hashes; regular expressions; [[type introspection|introspection]]; and an <code>eval()</code> function. Perl follows the theory of "no built-in limits",<ref name="schwartz01"/> an idea similar to the [[Zero One Infinity]] rule. Wall was trained as a linguist, and the design of Perl is very much informed by [[linguistic]] principles. Examples include [[Huffman coding]] (common constructions should be short), good end-weighting (the important information should come first), and a large collection of [[language primitive]]s. Perl favors language constructs that are concise and natural for humans to write, even where they complicate the Perl interpreter.<ref>{{Cite web|last=Wall|first=Larry|title=perl - The Perl 5 language interpreter - Perldoc Browser|url=https://perldoc.perl.org/perl|access-date=2021-06-24|website=perldoc.perl.org}}</ref> Perl's [[Syntax (programming languages)|syntax]] reflects the idea that "things that are different should look different."<ref name="wall97">{{cite journal |url=http://www.linuxjournal.com/article/2070 |title=Wherefore Art, Thou? |access-date=2011-03-13 |last=Wall |first=Larry |date=1997-03-01 |journal=[[Linux Journal]] |archive-date=December 9, 2010 |archive-url=https://web.archive.org/web/20101209021107/http://www.linuxjournal.com/article/2070 |url-status=live}}</ref> For example, scalars, arrays, and hashes have different leading sigils. Array indices and hash keys use different kinds of braces. Strings and regular expressions have different standard delimiters. There is a broad practical bent to both the Perl language and the community and culture that surround it. The preface to ''Programming Perl'' begins: "Perl is a language for getting your job done."<ref name="programmingperl2"/> One consequence of this is that Perl is not a tidy language. It includes many features, tolerates exceptions to its rules, and employs [[heuristics]] to resolve syntactical ambiguities. Because of the forgiving nature of the compiler, bugs can sometimes be hard to find. Perl's function documentation remarks on the variant behavior of built-in functions in list and scalar contexts by saying, "In general, they do what you want, unless you want consistency."<ref name="perlfunc">{{cite web |url=http://perldoc.perl.org/perlfunc.html |title=perlfunc - Perl builtin functions |access-date=2011-01-10 |work=Perl 5 version 12.2 documentation |publisher=perldoc.perl.org |archive-date=January 6, 2011 |archive-url=https://web.archive.org/web/20110106003034/http://perldoc.perl.org/perlfunc.html |url-status=live}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)