I am going to spend 30 minutes teaching Perl to an experienced programmer. The best way to learn Perl is by writing code. In addition to CPAN, what would you show a programmer so they would understand the expressiveness of Perl, the amount of functionality provided by CPAN, while keeping everything clean and tidy so they walk away comfortable with the language? I'll save the tricky stuff for another day.
use warnings; use strict; # use A_CPAN_LIB; sub example_func1 { # use the CPAN lib or demonstrate some basic feature of Perl } example_func1(); # ... __END__
Here's what I came up with...
Where to Start
Believe it or not, the man pages. Ok, we'll just use perldoc instead to be Windows friendly.
The perldoc pages (or man pages on Unix/Mac) are excellent for Perl. You can type man perl or perldoc perl
perldoc perl; # Show an overview and dozens of tutorials; man perl is the same.
perldoc perlintro; # A Perl intro for beginners; man perlintro
perldoc perlrequick; # An example Perl regex tutoral
perldoc perlfunc; # Shows builtin Perl functions
perldoc perlre; # More Perl regex.
CPAN
There are thousands of libraries on the Perl library site CPAN.
perl -MCPAN -e 'install DateTime'
perldoc works for installed modules too: perldoc module
perldoc DateTime
perldoc DBI; # Database API. If this doesn't work then install it:
perl -MCPAN -e 'install DBI'
Recommended Modules
perl -MCPAN -e 'install Moose'; # Perl does OOP
perldoc Moose; # Tell me more about the Moose
perl -MCPAN -e 'install CGI'; # Quick and dirty web pages
perl -MCPAN -e 'install Catalyst'; # Big web framework. Sometimes have problems installing. Google is your friend
perl -MCPAN -e 'install CGI::Application'; # Another web framework
perldoc CGI::Application; # Take a quick look at the docs
A little Q&A.
Q: Why should I use Perl instead Ruby or Python?
A: More people use Perl. There are more libraries for Perl(way more). Perl is a really great GTD language.
Q: Why do people hate Perl?
A: You can do some ugly stuff with it. Remember use warnings; use strict; in all of your code. You can check your code before running it. perl -c hello.pl
Perl Topics
Using Perl with Databases
http://www.perl.com/pub/a/1999/10/DBI.html
Using Perl for Web Development
http://www.catalystframework.org
OO Perl
http://www.iinteractive.com/moose
Perl 1-Liners
http://www.perlmonks.org/?node_id=470397
http://sial.org/howto/perl/one-liner
Other Tutorials
http://perlmonks.org/index.pl?node=Tutorials
Books
There are dozens.
http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Dstripbooks&field-keywords=perl&x=0&y=0
Websites
Perlmonks
Perl.org
Pleac
StackOverFlow's Hidden Features of Perl
CPAN FAQ
Randall Schwartz's articles
Getting Help
Perl Nabble Forum
IRC Channels: freenode, irc.perl.org. There are several:
irc://irc.perl.org/perl
irc://irc.perl.org/catalyst
irc://irc.freenode.net/modperl
irc://irc.perl.org/perl6