Difference between revisions of "Perl"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (→‎Usage: reference)
(→‎Questions: -> Notes)
Line 16: Line 16:
 
==Libraries and Modules==
 
==Libraries and Modules==
 
*[http://search.cpan.org/ CPAN]: search the Comprehensive Perl Archive Network
 
*[http://search.cpan.org/ CPAN]: search the Comprehensive Perl Archive Network
==Questions==
+
==Notes==
* Is it possible to intercept errors in Perl? This is especially critical when developing web applications, as a crashed Perl program will return a failure code to the web server (usually Apache), causing either a "500 Internal Server" error due to "premature end of script headers" or else a truncation of the output (with no apparent cause). Tracing these errors is especially difficult since Perl has no block-comment syntax (that I know of). '''Follow-up''': [http://www.perl.com/pub/a/2002/11/14/exception.html this] would seem to be a guide to exception-handling in Perl. Also [http://search.cpan.org/~pjordan/Exception-1.7/Exception.pm this]. And this: "use CGI::Carp qw(fatalsToBrowser);"
+
* 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 ( \' )
 +
** period ( \. )
 +
* 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);

Revision as of 14:03, 1 March 2006

This page is a seed article. You can help HTYP water it: make a request to expand a given page and/or donate to help give us more writing-hours!

Computing: Programming: Perl

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

Design

Other Documentation

  • CPAN: documentation links at the Comprehensive Perl Archive Network

Libraries and Modules

  • CPAN: search the Comprehensive Perl Archive Network

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 ( \' )
    • period ( \. )
  • 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);