perlfaq - frequently asked questions about Perl


perlfaq - frequently asked questions about Perl ($Date: 1999/05/23 20:38:02 $)


The perlfaq is structured into the following documents:

perlfaq: Structural overview of the FAQ.

This document.

the perlfaq1 manpage: General Questions About Perl

Very general, high-level information about Perl.

the perlfaq2 manpage: Obtaining and Learning about Perl

Where to find source and documentation to Perl, support, and related matters.

the perlfaq3 manpage: Programming Tools

Programmer tools and programming support.

the perlfaq4 manpage: Data Manipulation

Manipulating numbers, dates, strings, arrays, hashes, and miscellaneous data issues.

the perlfaq5 manpage: Files and Formats

I/O and the ``f'' issues: filehandles, flushing, formats and footers.

the perlfaq6 manpage: Regexps

Pattern matching and regular expressions.

the perlfaq7 manpage: General Perl Language Issues

General Perl language issues that don't clearly fit into any of the other sections.

the perlfaq8 manpage: System Interaction

Interprocess communication (IPC), control over the user-interface (keyboard, screen and pointing devices).

the perlfaq9 manpage: Networking

Networking, the Internet, and a few on the web.

About the perlfaq documents

Where to get the perlfaq

This document is posted regularly to comp.lang.perl.announce and several other related newsgroups. It is available in a variety of formats from CPAN in the /CPAN/doc/FAQs/FAQ/ directory or on the web at .

How to contribute to the perlfaq

You may mail corrections, additions, and suggestions to . This alias should not be used to ask FAQs. It's for fixing the current FAQ. Send questions to the comp.lang.perl.misc newsgroup.

What will happen if you mail your Perl programming problems to the authors

Your questions will probably go unread, unless they're suggestions of new questions to add to the FAQ, in which case they should have gone to the instead.

You should have read section 2 of this faq. There you would have learned that comp.lang.perl.misc is the appropriate place to go for free advice. If your question is really important and you require a prompt and correct answer, you should hire a consultant.


When I first began the Perl FAQ in the late 80s, I never realized it would have grown to over a hundred pages, nor that Perl would ever become so popular and widespread. This document could not have been written without the tremendous help provided by Larry Wall and the rest of the Perl Porters.

Author and Copyright Information

Copyright (c) 1997-1999 Tom Christiansen and Nathan Torkington. All rights reserved.

Bundled Distributions

When included as part of the Standard Version of Perl or as part of its complete documentation whether printed or otherwise, this work may be distributed only under the terms of Perl's Artistic License. Any distribution of this file or derivatives thereof outside of that package requires that special arrangements be made with copyright holder.

Irrespective of its distribution, all code examples in these files are hereby placed into the public domain. You are permitted and encouraged to use this code in your own programs for fun or for profit as you see fit. A simple comment in the code giving credit would be courteous but is not required.


This information is offered in good faith and in the hope that it may be of use, but is not guaranteed to be correct, up to date, or suitable for any particular purpose whatsoever. The authors accept no liability in respect of this information or its use.


  1. /November/2000
    A few grammatical fixes and updates implemented by John Borwick.

  2. /May/99
    Extensive updates from the net in preparation for 5.6 release.

  3. /April/99
    More minor touch-ups. Added new question at the end of perlfaq7 on variable names within variables.

  4. /January/99
    Small touchups here and there. Added all questions in this document as a sort of table of contents.

  5. /June/98
    Significant changes throughout in preparation for the 5.005 release.

  6. /April/97
    Style and whitespace changes from Chip, new question on reading one character at a time from a terminal using POSIX from Tom.

  7. /April/97
    Added to the perlfaq2 manpage. Style fix to the perlfaq3 manpage. Added floating point precision, fixed complex number arithmetic, cross-references, caveat for Text::Wrap, alternative answer for initial capitalizing, fixed incorrect regexp, added example of Tie::IxHash to the perlfaq4 manpage. Added example of passing and storing filehandles, added commify to the perlfaq5 manpage. Restored variable suicide, and added mass commenting to the perlfaq7 manpage. Added Net::Telnet, fixed backticks, added reader/writer pair to telnet question, added FindBin, grouped module questions together in the perlfaq8 manpage. Expanded caveats for the simple URL extractor, gave LWP example, added CGI security question, expanded on the mail address answer in the perlfaq9 manpage.

  8. /March/97
    Added more info to the binary distribution section of the perlfaq2 manpage. Added Net::Telnet to the perlfaq6 manpage. Fixed typos in the perlfaq8 manpage. Added mail sending example to the perlfaq9 manpage. Added Merlyn's columns to the perlfaq2 manpage.

  9. /March/97
    Added the DATE to the NAME section, indicating which sections have changed.

    Mentioned SIGPIPE and the perlipc manpage in the forking open answer in the perlfaq8 manpage.

    Fixed description of a regular expression in the perlfaq4 manpage.

  10. /March/97 Version
    Various typos fixed throughout.

    Added new question on Perl BNF on the perlfaq7 manpage.

    Initial Release: 11/March/97
    This is the initial release of version 3 of the FAQ; consequently there have been no changes since its initial release.

 perlfaq - frequently asked questions about Perl