Dual-license your content for inclusion in The Perl 5 Wiki using this HOWTO, or join us for a chat on irc.freenode.net#PerlNet.

Learning Perl

From PerlNet

Jump to: navigation, search

So you want to learn Perl

  1. Recommended (but optional) start: get familiar with your command line
    1. Many tutorials will suggest running interactive perl commands or starting a debugger from a command line or shell
    2. In Windows, this means getting familiar with the "Command Prompt"; in OS X the Terminal app in Utilities; and in *nix, your default shell or console app.
    3. At a minimum, you'll probably want to know how to: list files, change directories, start a program, and stop a program that's running
    4. To check if a version of perl is installed and in your default search path, run the command line: "perl --version"
  2. Download and install Perl
    1. Windows: the recommended install is ActiveState's ActivePerl; it includes a special tool called ppm to install prebuilt perl modules without requiring any additional development tools (e.g. C compilers for custom extensions). An alternative approach would be to install Cygwin (a Linux-like environment for Windows) and use the cygwin setup to install perl. Note that Cygwin and ActivePerl use different environments so you cannot mix and match installers; any modules generally have to be installed separately for each environment.
    2. OS X: perl is included in the default installs of OS X 10.3 (Panther) and OS X 10.4 (Tiger), and periodic updates are provided by Apple in the normal Software Update process. The recommended setup is to use the default installed perl, unless you have specific need of a newer version. Other options include ActivePerl as well as building from source.
    3. Linux: perl is generally included in the default setup. The recommended install or upgrade is via your Linux environments' package management system, eg "emerge" on Gentoo. Another less common option is ActivePerl .. generally you will have an easier time installing additional modules using the default package management system. A fuller explanation on using the Perl CPAN module repository with your Linux package management system is available in the Hints and Tips
  3. Make sure you can run Perl from the command line by typing:
    perl --version
    1. Note: A modern and recommended version of perl is 5.10.1 or greater, however any version from 5.6.x onward would be suitable to learn on.
  4. Make sure you have a text editor that can save plain text (you may wish to have a look at some of the text editor alternatives on the developer tools page.
    1. Note: Do not be tempted by any of the fancy IDE's and similar tools that are available until you are comfortable with programming and debugging Perl. You are far better off with a simple editor and a command line prompt in the first instance. The Perl debugger is built into Perl itself.
  5. Get some tutorial reading matter, for instance:
    1. Review the Learn Perl and Perl Begin websites
    2. Read perlintro and peruse the FAQs;
    3. Download Introduction to Perl or one of the other freely available course notes from Perl Training Australia;
    4. Review the Perl Monks Tutorials section;
    5. Locate one of the other many Perl texts on the Net, e.g. Programming:Perl from the Wikibooks:Programming languages bookshelf;
    6. Check out The Perl Monk guide to "Where and how to start learning Perl"
    7. Get a good Perl book -- look at the links on the Perl book reviews page for some suggestions.
  6. Hack away!
  7. Ask for help when you get stuck
    1. Perl Monks
    2. Local Perl Mongers
    3. Help with perl
    4. The PerlNet mailing list
    5. The PerlNet IRC channel
  8. Browse the Internet for information
  9. Look at the Next steps page

Other resources

Personal tools