Content deleted Content added
m Wrong Java |
m Typo fixing, Typos fixed: langauge → language, occassions → occasions, using AWB |
||
Line 1:
A '''Perl module''' is a discrete component of software for the [[Perl]] programming language. A module is distinguished by a unique namespace, e.g. "CGI" or "Net::FTP" or "XML::Parser" and a filename similarly named (ie. Net::FTP lives in Net/FTP.pm). A collection of one or more modules, with accompanying documentation and build scripts, compose a distribution. The Perl community has a sizable library of distributions available for search and download via [[CPAN]].
Perl is a language allowing many different styles of programming. You're as likely to find a module written in a [[procedural]] style (for example, [http://search.cpan.org/dist/Test-Simple Test-Simple]) as [[object-oriented]] (ex. [http://search.cpan.org/dist/XML-Parser XML-Parser]), both are considered equally valid according to what the module needs to do. Modules might also be used to [[mixin]] methods ([http://search.cpan.org/dist/DBIx-Class DBIx-Class]) or be a [[compiler directive|pragma]] ([http://perldoc.perl.org/strict.html strict.pm]) which has an effect immediately upon being loaded. Modules can even be used to alter the syntax of the
It is common for Perl modules to have embedded documentation in Perl's [[Plain Old Documentation]] format. POD imposes little structure on the author. It is flexible enough to be used to write articles, web pages and even entire books such as [http://www.oreilly.com/catalog/pperl3/colophon.html Programming Perl]. Contrast with [[javadoc]] which is specialized to documenting [[Java (programming language)|Java]] classes. By convention, module documentation typically follows the structure of a [[Manual page (Unix)|Unix man page]].
The language of Perl is defined by the single implementation (referred to as "perl") and is added to (and in rare
== Examples ==
Line 18 ⟶ 17:
print "Hello, world!\n";
=== Procedural Example ===
Line 258 ⟶ 256:
----
== Further
* [http://perldoc.perl.org/perlmod.html Perl modules (packages and symbol tables)]
|