Documentation

perldoc

  • Perldoc is the complete language reference for Perl
  • perldoc perldoc for usage instructions
  • perldoc perl for an overview of the documentation
  • perldoc Module for a module's documentation

Look up any function with perldoc -f

  1. $ perldoc -f system
  2.  
  3. system LIST
  4. system PROGRAM LIST
  5. Does exactly the same thing as "exec LIST", except that a fork
  6. is done first, and the parent process waits for the child
  7. ...

Search the Perl FAQ with perldoc -q

  1. $ perldoc -q database
  2.  
  3. Found in /System/Library/Perl/5.8.6/pods/perlfaq8.pod
  4. How do I use an SQL database?
  5.  
  6. The DBI module provides an abstract interface to most database servers
  7. and types, including Oracle, DB2, Sybase, mysql, Postgresql, ODBC, and

Look up module documents with perldoc modulename

If a module is installed on your system, you can see the docs for it.

  1. $ perldoc WWW::Mechanize
  2.  
  3. NAME
  4. WWW::Mechanize -- Handy web browsing in a Perl object
  5.  
  6. VERSION
  7. Version 1.20
  8.  
  9. SYNOPSIS
  10. "WWW::Mechanize", or Mech for short, helps you automate interaction
  11. with a website. It supports performing a sequence of page fetches

For modules that you haven't installed, you'll need to use http://search.cpan.org.

Online documentation

There are some websites that HTMLify the Perl documentation. The two biggest ones:

Writing your own documentation

Perl has a strong culture of documenting everything, and you are encouraged to get into this habit early on. You'll write your documentation using a format called POD, which is discussed in its own page.


Want to contribute?

Submit a PR to github.com/petdance/perl101