perlfaq.html
来自「perl教程」· HTML 代码 · 共 1,136 行 · 第 1/3 页
HTML
1,136 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>perlfaq - frequently asked questions about Perl</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',2);</script>
<h1><a>perlfaq - frequently asked questions about Perl</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#where_to_get_the_perlfaq">Where to get the perlfaq</a></li>
<li><a href="#how_to_contribute_to_the_perlfaq">How to contribute to the perlfaq</a></li>
<li><a href="#what_will_happen_if_you_mail_your_perl_programming_problems_to_the_authors">What will happen if you mail your Perl programming problems to the authors?</a></li>
</ul>
<li><a href="#credits">CREDITS</a></li>
<li><a href="#author_and_copyright">AUTHOR AND COPYRIGHT</a></li>
<li><a href="#table_of_contents">Table of Contents</a></li>
<li><a href="#the_questions">The Questions</a></li>
<ul>
<li><a href="#perlfaq1__general_questions_about_perl"><a href="../../lib/Pod/perlfaq1.html">the perlfaq1 manpage</a>: General Questions About Perl</a></li>
<li><a href="#perlfaq2__obtaining_and_learning_about_perl"><a href="../../lib/Pod/perlfaq2.html">the perlfaq2 manpage</a>: Obtaining and Learning about Perl</a></li>
<li><a href="#perlfaq3__programming_tools"><a href="../../lib/Pod/perlfaq3.html">the perlfaq3 manpage</a>: Programming Tools</a></li>
<li><a href="#perlfaq4__data_manipulation"><a href="../../lib/Pod/perlfaq4.html">the perlfaq4 manpage</a>: Data Manipulation</a></li>
<li><a href="#perlfaq5__files_and_formats"><a href="../../lib/Pod/perlfaq5.html">the perlfaq5 manpage</a>: Files and Formats</a></li>
<li><a href="#perlfaq6__regular_expressions"><a href="../../lib/Pod/perlfaq6.html">the perlfaq6 manpage</a>: Regular Expressions</a></li>
<li><a href="#perlfaq7__general_perl_language_issues"><a href="../../lib/Pod/perlfaq7.html">the perlfaq7 manpage</a>: General Perl Language Issues</a></li>
<li><a href="#perlfaq8__system_interaction"><a href="../../lib/Pod/perlfaq8.html">the perlfaq8 manpage</a>: System Interaction</a></li>
<li><a href="#perlfaq9__networking"><a href="../../lib/Pod/perlfaq9.html">the perlfaq9 manpage</a>: Networking</a></li>
</ul>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>perlfaq - frequently asked questions about Perl</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The perlfaq comprises several documents that answer the most commonly
asked questions about Perl and Perl programming. It's divided by topic
into nine major sections outlined in this document.</p>
<p>
</p>
<h2><a name="where_to_get_the_perlfaq">Where to get the perlfaq</a></h2>
<p>The perlfaq comes with the standard Perl distribution, so if you have Perl
you should have the perlfaq. You should also have the <code>perldoc</code> tool
that let's you read the <a href="../../lib/Pod/perlfaq.html">the perlfaq manpage</a>:</p>
<pre>
$ <a href="../../lib/Pod/perldoc.html">perldoc</a> <a href="../../lib/Pod/perlfaq.html">perlfaq</a></pre>
<p>Besides your local system, you can find the perlfaq on the web, including
at <a href="http://perldoc.perl.org/">http://perldoc.perl.org/</a> .</p>
<p>The perlfaq is an evolving document and you can read the latest version
at <a href="http://faq.perl.org/">http://faq.perl.org/</a> . The perlfaq-workers periodically post extracts
of the latest perlfaq to comp.lang.perl.misc.</p>
<p>You can view the source tree at
<a href="http://cvs.perl.org/viewcvs/cvs-public/perlfaq/">http://cvs.perl.org/viewcvs/cvs-public/perlfaq/</a> (which is outside of the
main Perl source tree). The CVS repository notes all changes to the FAQ
and holds the latest version of the working documents and may vary
significantly from the version distributed with the latest version of
Perl. Check the repository before sending your corrections.</p>
<p>
</p>
<h2><a name="how_to_contribute_to_the_perlfaq">How to contribute to the perlfaq</a></h2>
<p>You can mail corrections, additions, and suggestions to
<code><perlfaq-workers AT perl DOT org></code>. The perlfaq volunteers use this
address to coordinate their efforts and track the perlfaq development.
They appreciate your contributions to the FAQ but do not have time to
provide individual help, so don't use this address to ask FAQs.</p>
<p>The perlfaq server posts extracts of the perlfaq to that newsgroup every
6 hours (or so), and the community of volunteers reviews and updates the
answers. If you'd like to help review and update the answers, check out
comp.lang.perl.misc.</p>
<p>
</p>
<h2><a name="what_will_happen_if_you_mail_your_perl_programming_problems_to_the_authors">What will happen if you mail your Perl programming problems to the authors?</a></h2>
<p>The perlfaq-workers like to keep all traffic on the perlfaq-workers list
so that everyone can see the work being done (and the work that needs to
be done). The mailing list serves as an official record. If you email the
authors or maintainers directly, you'll probably get a reply asking you
to post to the mailing list. If you don't get a reply, it probably means
that the person never saw the message or didn't have time to deal with
it. Posting to the list allows the volunteers with time to deal with it
when others are busy.</p>
<p>If you have a question that isn't in the FAQ and you would like help with
it, try the resources in <a href="../../lib/Pod/perlfaq2.html">the perlfaq2 manpage</a>.</p>
<p>
</p>
<hr />
<h1><a name="credits">CREDITS</a></h1>
<p>Tom Christiansen wrote the original perlfaq then expanded it with the
help of Nat Torkington. The perlfaq-workers maintain current document
and the dezinens of comp.lang.perl.misc regularly review and update the
FAQ. Several people have contributed answers, corrections, and comments,
and the perlfaq notes those contributions wherever appropriate.</p>
<p>
</p>
<hr />
<h1><a name="author_and_copyright">AUTHOR AND COPYRIGHT</a></h1>
<p>Tom Christainsen wrote the original version of this document.
brian d foy <code><bdfoy@cpan.org></code> wrote this version. See the
individual perlfaq documents for additional copyright information.</p>
<p>This document is available under the same terms as Perl itself. Code
examples in all the perlfaq documents are in the public domain. Use
them as you see fit (and at your own risk with no warranty from anyone).</p>
<p>
</p>
<hr />
<h1><a name="table_of_contents">Table of Contents</a></h1>
<dl>
<dt><strong><a name="item_perlfaq__2d_this_document">perlfaq - this document</a></strong>
<dt><strong><a name="item_perlfaq1__2d_general_questions_about_perl">perlfaq1 - General Questions About Perl</a></strong>
<dt><strong><a name="item_perlfaq2__2d_obtaining_and_learning_about_perl">perlfaq2 - Obtaining and Learning about Perl</a></strong>
<dt><strong><a name="item_perlfaq3__2d_programming_tools">perlfaq3 - Programming Tools</a></strong>
<dt><strong><a name="item_perlfaq4__2d_data_manipulation">perlfaq4 - Data Manipulation</a></strong>
<dt><strong><a name="item_perlfaq5__2d_files_and_formats">perlfaq5 - Files and Formats</a></strong>
<dt><strong><a name="item_perlfaq6__2d_regular_expressions">perlfaq6 - Regular Expressions</a></strong>
<dt><strong><a name="item_perlfaq7__2d_general_perl_language_issues">perlfaq7 - General Perl Language Issues</a></strong>
<dt><strong><a name="item_perlfaq8__2d_system_interaction">perlfaq8 - System Interaction</a></strong>
<dt><strong><a name="item_perlfaq9__2d_networking">perlfaq9 - Networking</a></strong>
</dl>
<p>
</p>
<hr />
<h1><a name="the_questions">The Questions</a></h1>
<p>
</p>
<h2><a name="perlfaq1__general_questions_about_perl"><a href="../../lib/Pod/perlfaq1.html">the perlfaq1 manpage</a>: General Questions About Perl</a></h2>
<p>Very general, high-level questions about Perl.</p>
<ul>
<li>
<p>What is Perl?</p>
</li>
<li>
<p>Who supports Perl? Who develops it? Why is it free?</p>
</li>
<li>
<p>Which version of Perl should I use?</p>
</li>
<li>
<p>What are perl4, perl5, or perl6?</p>
</li>
<li>
<p>What is Ponie?</p>
</li>
<li>
<p>What is perl6?</p>
</li>
<li>
<p>How stable is Perl?</p>
</li>
<li>
<p>Is Perl difficult to learn?</p>
</li>
<li>
<p>How does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl?</p>
</li>
<li>
<p>Can I do [task] in Perl?</p>
</li>
<li>
<p>When shouldn't I program in Perl?</p>
</li>
<li>
<p>What's the difference between "perl" and "Perl"?</p>
</li>
<li>
<p>Is it a Perl program or a Perl script?</p>
</li>
<li>
<p>What is a JAPH?</p>
</li>
<li>
<p>Where can I get a list of Larry Wall witticisms?</p>
</li>
<li>
<p>How can I convince my sysadmin/supervisor/employees to use version 5/5.6.1/Perl instead of some other language?</p>
</li>
</ul>
<p>
</p>
<h2><a name="perlfaq2__obtaining_and_learning_about_perl"><a href="../../lib/Pod/perlfaq2.html">the perlfaq2 manpage</a>: Obtaining and Learning about Perl</a></h2>
<p>Where to find source and documentation for Perl, support, and related matters.</p>
<ul>
<li>
<p>What machines support perl? Where do I get it?</p>
</li>
<li>
<p>How can I get a binary version of perl?</p>
</li>
<li>
<p>I don't have a C compiler. How can I build my own Perl interpreter?</p>
</li>
<li>
<p>I copied the perl binary from one machine to another, but scripts don't work.</p>
</li>
<li>
<p>I grabbed the sources and tried to compile but gdbm/dynamic loading/malloc/linking/... failed. How do I make it work?</p>
</li>
<li>
<p>What modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean?</p>
</li>
<li>
<p>Is there an ISO or ANSI certified version of Perl?</p>
</li>
<li>
<p>Where can I get information on Perl?</p>
</li>
<li>
<p>What are the Perl newsgroups on Usenet? Where do I post questions?</p>
</li>
<li>
<p>Where should I post source code?</p>
</li>
<li>
<p>Perl Books</p>
</li>
<li>
<p>Which magazines have Perl content?</p>
</li>
<li>
<p>What mailing lists are there for Perl?</p>
</li>
<li>
<p>Where are the archives for comp.lang.perl.misc?</p>
</li>
<li>
<p>Where can I buy a commercial version of perl?</p>
</li>
<li>
<p>Where do I send bug reports?</p>
</li>
<li>
<p>What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?</p>
</li>
</ul>
<p>
</p>
<h2><a name="perlfaq3__programming_tools"><a href="../../lib/Pod/perlfaq3.html">the perlfaq3 manpage</a>: Programming Tools</a></h2>
<p>Programmer tools and programming support.</p>
<ul>
<li>
<p>How do I do (anything)?</p>
</li>
<li>
<p>How can I use Perl interactively?</p>
</li>
<li>
<p>Is there a Perl shell?</p>
</li>
<li>
<p>How do I find which modules are installed on my system?</p>
</li>
<li>
<p>How do I debug my Perl programs?</p>
</li>
<li>
<p>How do I profile my Perl programs?</p>
</li>
<li>
<p>How do I cross-reference my Perl programs?</p>
</li>
<li>
<p>Is there a pretty-printer (formatter) for Perl?</p>
</li>
<li>
<p>Is there a ctags for Perl?</p>
</li>
<li>
<p>Is there an IDE or Windows Perl Editor?</p>
</li>
<li>
<p>Where can I get Perl macros for vi?</p>
</li>
<li>
<p>Where can I get perl-mode for emacs?</p>
</li>
<li>
<p>How can I use curses with Perl?</p>
</li>
<li>
<p>How can I use X or Tk with Perl?</p>
</li>
<li>
<p>How can I make my Perl program run faster?</p>
</li>
<li>
<p>How can I make my Perl program take less memory?</p>
</li>
<li>
<p>Is it safe to return a reference to local or lexical data?</p>
</li>
<li>
<p>How can I free an array or hash so my program shrinks?</p>
</li>
<li>
<p>How can I make my CGI script more efficient?</p>
</li>
<li>
<p>How can I hide the source for my Perl program?</p>
</li>
<li>
<p>How can I compile my Perl program into byte code or C?</p>
</li>
<li>
<p>How can I compile Perl into Java?</p>
</li>
<li>
<p>How can I get <code>#!perl</code> to work on [MS-DOS,NT,...]?</p>
</li>
<li>
<p>Can I write useful Perl programs on the command line?</p>
</li>
<li>
<p>Why don't Perl one-liners work on my DOS/Mac/VMS system?</p>
</li>
<li>
<p>Where can I learn about CGI or Web programming in Perl?</p>
</li>
<li>
<p>Where can I learn about object-oriented Perl programming?</p>
</li>
<li>
<p>Where can I learn about linking C with Perl?</p>
</li>
<li>
<p>I've read perlembed, perlguts, etc., but I can't embed perl in my C program; what am I doing wrong?</p>
</li>
<li>
<p>When I tried to run my script, I got this message. What does it mean?</p>
</li>
<li>
<p>What's MakeMaker?</p>
</li>
</ul>
<p>
</p>
<h2><a name="perlfaq4__data_manipulation"><a href="../../lib/Pod/perlfaq4.html">the perlfaq4 manpage</a>: Data Manipulation</a></h2>
<p>Manipulating numbers, dates, strings, arrays, hashes, and miscellaneous data issues.</p>
<ul>
<li>
<p>Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?</p>
</li>
<li>
<p>Why is <a href="../../lib/Pod/perlfunc.html#item_int"><code>int()</code></a> broken?</p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?