develooper Front page | perl.tips | Postings from July 2001

Perl Tip 2: Use the perldoc, Luke

From:
Ask Bjoern Hansen
Date:
July 18, 2001 15:23
Subject:
Perl Tip 2: Use the perldoc, Luke
Message ID:
Pine.BSF.4.21.0107181522150.60218-100000@onion.valueclick.com

If you have perl installed then you have a wealth of very useful
documentation "right at your fingertips", as they say. It is all in
the "perldoc" command, usually installed in the same directory as
"perl" itself.

For starters, try to run

  perldoc perl

which will give you an index of the documentation supplied with perl.


For example, go to the section about data structures with

  perldoc perldata


The FAQ is also included! Try

  perldoc perlfaq1 

(or perlfaq2, perlfaq3, and so forth).


You can search the faq with the -q parameter, try for example

  perldoc -q "send mail"


You can get help on a specific Perl function by using the -f
parameter, for example

  perldoc -f sort

will give you help on the sort function. Pretty cool, huh? I use it
all the time. You can add -t (so it would be "perldoc -tf sort") to
see the output as plain text instead of as "POD" (-t is the default on
Windows).


And it gets better! Most modules have built in documentation which you
can read it with "perldoc modulename", for example

  perldoc CGI

will give you the built in documentation for the CGI.pm module.


In the pipeline for the daily-tips list are tips about finding modules
and using CPAN and we'll have a series of tips about the various Perl
web sites that are useful and interesting for Perl programmers. So
stay tuned! :-)

   #
   #  You can still make it to this years Perl conference.
   #  It will starts next Monday in San Diego. It's loads of
   #  fun, and if you come along I promise that your brain
   #  will hurt by the end of the week from all the cool
   #  stuff you've learned. :-) (And you will meet lots of
   #  cool people too!)
   #   
   #     http://conferences.oreilly.com/oscon/
   #
   #  Send me a mail if you would like to get a few tips on
   #  cheap accommodation down the street from the
   #  conference center.
   #


To unsubscribe: mail daily-tips-unsubscribe@perl.org
To subscribe: mail daily-tips-subscribe@perl.org
Or visit: http://learn.perl.org/tips/
Comments, suggestions? Send them to ask@perl.org.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About