Difference between revisions of "Perl"
Jump to navigation
Jump to search
m (→Usage: link to perl manpage) |
(→Reference: official perl 6 doc) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | [[computing]]: [[software]]: [[programming]]: [[Perl]]{{seedling}} | |
− | + | ==Overview== | |
[[Perl]] is a programming language widely used for web sites and [[Linux]] servers. It can be somewhat baffling to the eye – largely due to the frequent use of [[Perl regex|regular expressions]] – but due to its popularity it has been greatly refined and there is a large base of existing code available for reuse. | [[Perl]] is a programming language widely used for web sites and [[Linux]] servers. It can be somewhat baffling to the eye – largely due to the frequent use of [[Perl regex|regular expressions]] – but due to its popularity it has been greatly refined and there is a large base of existing code available for reuse. | ||
− | |||
==Articles== | ==Articles== | ||
===Usage=== | ===Usage=== | ||
Line 10: | Line 9: | ||
* '''official documentation''' | * '''official documentation''' | ||
** [[perl manpage]] | ** [[perl manpage]] | ||
− | |||
===Design=== | ===Design=== | ||
* [[Perl vs. PHP]] | * [[Perl vs. PHP]] | ||
+ | ==Links== | ||
+ | ===Reference=== | ||
+ | * [http://perl.org official Perl web site] | ||
+ | * {{wikipedia|Perl}} | ||
+ | * [http://www.cpan.org/ CPAN]: documentation links at the Comprehensive Perl Archive Network | ||
+ | * '''Perl 6''''s official release is expected any month now: | ||
+ | ** [http://perlcabal.org/syn/ Official Perl 6 Documentation] | ||
+ | |||
+ | ===Tutorials=== | ||
+ | * From the Perl Advent Calendar (2006): | ||
+ | ** [http://perladvent.pm.org/2006/1/ Good things come in small packages]: the standard profiler and a new line-by-line profiler | ||
+ | ** [http://perladvent.pm.org/2006/2/ Peeking under the tree]: an object-oriented directory-tree spider | ||
+ | ** [http://perladvent.pm.org/2006/4/ Are you naughty or nice?]: a lighter version of the CGI module | ||
+ | ** [http://perladvent.pm.org/2006/9/ Made my sister eat a bug]: the Perl debugger, and an alternative | ||
+ | ** [http://perladvent.pm.org/2006/11/ Putting Tinsel on the Tree]: using GD and GD::Simple graphics-drawing libraries | ||
+ | |||
+ | ===Other=== | ||
+ | * [http://feather.perl6.nl:8080/cgi-bin/runpugs? PUGS], the Perl6 User's Golfing System: online simulation of Perl6 | ||
+ | * [[Larry Wall]]'s writings: | ||
+ | ** [http://www.wall.org/~larry/pm.html Perl, the first postmodern computer language] | ||
+ | ** '''2006-09-06''' [http://interviews.slashdot.org/interviews/02/09/06/1343222.shtml?tid=145 Larry Wall On Perl, Religion, and...]: mostly about Perl6, with some religious discussion | ||
− | |||
− | |||
==Libraries and Modules== | ==Libraries and Modules== | ||
− | *[http://search.cpan.org/ CPAN]: search the Comprehensive Perl Archive Network | + | * '''Collections''': |
+ | ** [http://search.cpan.org/ CPAN]: search the Comprehensive Perl Archive Network | ||
+ | * '''Frequently-used libraries''': | ||
+ | ** [[Perl DBI]]: database interface | ||
+ | ** [http://search.cpan.org/~jzucker/DBD-AnyData-0.08/AnyData.pm DBD::AnyData]: handles a number of common data formats (expandable) with a DBI-like API | ||
+ | ** [http://search.cpan.org/~stevan/Moose/lib/Moose.pm Moose]: an improved [[object-oriented programming|OOP]] module for Perl5 (Perl6 has better OOP built in) | ||
+ | * '''Frameworks''' | ||
+ | ** [[Catalyst (framework)|Catalyst]]: web applications | ||
+ | |||
==Notes== | ==Notes== | ||
* Although single-quoted strings are widely cited as not interpreting anything, you do have to backslash certain characters if you want them represented literally: | * Although single-quoted strings are widely cited as not interpreting anything, you do have to backslash certain characters if you want them represented literally: | ||
** the single-quote itself ( \' ) | ** the single-quote itself ( \' ) | ||
− | ** | + | ** the backslash character ( \\ ) |
* One of the reasons for [[PHP]]'s popularity over [[Perl vs. PHP|Perl]] for developing web applications is that it prints errors to the web browser, rather than simply quitting abruptly (causing either an incomplete page or, more likely, a 5xx Server Error). Perl does not do this by default. It is, however, quite easy to make this happen, by including the following line of code near the beginning of a program: | * One of the reasons for [[PHP]]'s popularity over [[Perl vs. PHP|Perl]] for developing web applications is that it prints errors to the web browser, rather than simply quitting abruptly (causing either an incomplete page or, more likely, a 5xx Server Error). Perl does not do this by default. It is, however, quite easy to make this happen, by including the following line of code near the beginning of a program: | ||
use CGI::Carp qw(fatalsToBrowser); | use CGI::Carp qw(fatalsToBrowser); | ||
+ | * Although there is apparently no formal block-quote syntax (like /* */ in c/c++), a syntax used for documentation seems to accomplish the same thing. It's not presently known whether this is documented anywhere. "=''anystring''", at the beginning of a line, starts a block comment, and "=cut" at the beginning of a line ends the comment. This has not been tested thoroughly, but the exact string "cut" does seem to be necessary. Example: | ||
+ | regular_code_here(); | ||
+ | ==something | ||
+ | This part is commented, i.e. ignored by the parser. | ||
+ | Anything up until the "cut" line. | ||
+ | ==cut | ||
+ | more_code(); |
Latest revision as of 01:32, 28 April 2007
computing: software: programming: Perl
Overview
Perl is a programming language widely used for web sites and Linux servers. It can be somewhat baffling to the eye – largely due to the frequent use of regular expressions – but due to its popularity it has been greatly refined and there is a large base of existing code available for reuse.
Articles
Usage
- Perl reference
- Perl built-in functions
- Perl regex
- official documentation
Design
Links
Reference
- official Perl web site
- Wikipedia
- CPAN: documentation links at the Comprehensive Perl Archive Network
- Perl 6's official release is expected any month now:
Tutorials
- From the Perl Advent Calendar (2006):
- Good things come in small packages: the standard profiler and a new line-by-line profiler
- Peeking under the tree: an object-oriented directory-tree spider
- Are you naughty or nice?: a lighter version of the CGI module
- Made my sister eat a bug: the Perl debugger, and an alternative
- Putting Tinsel on the Tree: using GD and GD::Simple graphics-drawing libraries
Other
- PUGS, the Perl6 User's Golfing System: online simulation of Perl6
- Larry Wall's writings:
- Perl, the first postmodern computer language
- 2006-09-06 Larry Wall On Perl, Religion, and...: mostly about Perl6, with some religious discussion
Libraries and Modules
- Collections:
- CPAN: search the Comprehensive Perl Archive Network
- Frequently-used libraries:
- Perl DBI: database interface
- DBD::AnyData: handles a number of common data formats (expandable) with a DBI-like API
- Moose: an improved OOP module for Perl5 (Perl6 has better OOP built in)
- Frameworks
- Catalyst: web applications
Notes
- Although single-quoted strings are widely cited as not interpreting anything, you do have to backslash certain characters if you want them represented literally:
- the single-quote itself ( \' )
- the backslash character ( \\ )
- One of the reasons for PHP's popularity over Perl for developing web applications is that it prints errors to the web browser, rather than simply quitting abruptly (causing either an incomplete page or, more likely, a 5xx Server Error). Perl does not do this by default. It is, however, quite easy to make this happen, by including the following line of code near the beginning of a program:
use CGI::Carp qw(fatalsToBrowser);
- Although there is apparently no formal block-quote syntax (like /* */ in c/c++), a syntax used for documentation seems to accomplish the same thing. It's not presently known whether this is documented anywhere. "=anystring", at the beginning of a line, starts a block comment, and "=cut" at the beginning of a line ends the comment. This has not been tested thoroughly, but the exact string "cut" does seem to be necessary. Example:
regular_code_here(); ==something This part is commented, i.e. ignored by the parser. Anything up until the "cut" line. ==cut more_code();