CINXE.COM

perlfaq - Frequently asked questions about Perl - Perldoc Browser

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>perlfaq - Frequently asked questions about Perl - Perldoc Browser</title> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser"> <link rel="canonical" href="https://perldoc.perl.org/perlfaq"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" /> <style> body { background: #f4f4f5; color: #020202; } .navbar-dark { background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%); background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%); background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0); background-repeat: repeat-x; } .navbar-dark .navbar-nav .nav-link, .navbar-dark .navbar-nav .nav-link:focus { color: #fff } .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 } #wrapperlicious { margin: 0 auto; font: 0.9em 'Helvetica Neue', Helvetica, sans-serif; font-weight: normal; line-height: 1.5em; margin: 0; padding: 0; } #wrapperlicious h1 { font-size: 1.5em } #wrapperlicious h2 { font-size: 1.3em } #wrapperlicious h3 { font-size: 1.1em } #wrapperlicious h4 { font-size: 0.9em } #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3, #wrapperlicious h4, #wrapperlicious dt { color: #020202; margin-top: 1em; margin-bottom: 1em; position: relative; font-weight: bold; } #wrapperlicious a { color: inherit; text-decoration: underline } #wrapperlicious #toc { text-decoration: none } #wrapperlicious a:hover { color: #2a2a2a } #wrapperlicious a img { border: 0 } #wrapperlicious :not(pre) > code { color: inherit; background-color: rgba(0, 0, 0, 0.04); border-radius: 3px; font: 0.9em Consolas, Menlo, Monaco, monospace; padding: 0.3em; } #wrapperlicious dd { margin: 0; margin-left: 2em; } #wrapperlicious dt { color: #2a2a2a; font-weight: bold; margin-left: 0.9em; } #wrapperlicious p { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious li > p { margin-bottom: 0; margin-top: 0; } #wrapperlicious pre { border: 1px solid #c1c1c1; border-radius: 3px; font: 100% Consolas, Menlo, Monaco, monospace; margin-bottom: 1em; margin-top: 1em; } #wrapperlicious pre > code { display: block; background-color: #f6f6f6; font: 0.9em Consolas, Menlo, Monaco, monospace; line-height: 1.5em; text-align: left; white-space: pre; padding: 1em; } #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious ul { list-style-type: square; } #wrapperlicious ul ul { margin-bottom: 0px; margin-top: 0px; } #footer { font-size: 0.8em; padding-top: 0.5em; text-align: center; } #more { display: inline; font-size: 0.8em; } #perldocdiv { background-color: #fff; border: 1px solid #c1c1c1; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; margin-left: auto; margin-right: auto; padding: 3em; padding-top: 1em; max-width: 960px; } #moduleversion { float: right } #wrapperlicious .leading-notice { font-style: italic; padding-left: 1em; margin-top: 1em; margin-bottom: 1em; } #wrapperlicious .permalink { display: none; left: -0.75em; position: absolute; padding-right: 0.25em; text-decoration: none; } #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink, #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink, #wrapperlicious dt:hover .permalink { display: block; } </style> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KVNWBNT5FB'); gtag('config', 'UA-50555-3'); </script> </head> <body> <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="/">Perldoc Browser</a> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.40.0</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-stable"> <a class="dropdown-item" href="/perlfaq">Latest</a> <div class="dropdown-divider"></div> <a class="dropdown-item active" href="/5.40.0/perlfaq">5.40.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.2/perlfaq">5.38.2</a> <a class="dropdown-item" href="/5.38.1/perlfaq">5.38.1</a> <a class="dropdown-item" href="/5.38.0/perlfaq">5.38.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.36.3/perlfaq">5.36.3</a> <a class="dropdown-item" href="/5.36.2/perlfaq">5.36.2</a> <a class="dropdown-item" href="/5.36.1/perlfaq">5.36.1</a> <a class="dropdown-item" href="/5.36.0/perlfaq">5.36.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.34.3/perlfaq">5.34.3</a> <a class="dropdown-item" href="/5.34.2/perlfaq">5.34.2</a> <a class="dropdown-item" href="/5.34.1/perlfaq">5.34.1</a> <a class="dropdown-item" href="/5.34.0/perlfaq">5.34.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.32.1/perlfaq">5.32.1</a> <a class="dropdown-item" href="/5.32.0/perlfaq">5.32.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.30.3/perlfaq">5.30.3</a> <a class="dropdown-item" href="/5.30.2/perlfaq">5.30.2</a> <a class="dropdown-item" href="/5.30.1/perlfaq">5.30.1</a> <a class="dropdown-item" href="/5.30.0/perlfaq">5.30.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.28.3/perlfaq">5.28.3</a> <a class="dropdown-item" href="/5.28.2/perlfaq">5.28.2</a> <a class="dropdown-item" href="/5.28.1/perlfaq">5.28.1</a> <a class="dropdown-item" href="/5.28.0/perlfaq">5.28.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.26.3/perlfaq">5.26.3</a> <a class="dropdown-item" href="/5.26.2/perlfaq">5.26.2</a> <a class="dropdown-item" href="/5.26.1/perlfaq">5.26.1</a> <a class="dropdown-item" href="/5.26.0/perlfaq">5.26.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.24.4/perlfaq">5.24.4</a> <a class="dropdown-item" href="/5.24.3/perlfaq">5.24.3</a> <a class="dropdown-item" href="/5.24.2/perlfaq">5.24.2</a> <a class="dropdown-item" href="/5.24.1/perlfaq">5.24.1</a> <a class="dropdown-item" href="/5.24.0/perlfaq">5.24.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.22.4/perlfaq">5.22.4</a> <a class="dropdown-item" href="/5.22.3/perlfaq">5.22.3</a> <a class="dropdown-item" href="/5.22.2/perlfaq">5.22.2</a> <a class="dropdown-item" href="/5.22.1/perlfaq">5.22.1</a> <a class="dropdown-item" href="/5.22.0/perlfaq">5.22.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.20.3/perlfaq">5.20.3</a> <a class="dropdown-item" href="/5.20.2/perlfaq">5.20.2</a> <a class="dropdown-item" href="/5.20.1/perlfaq">5.20.1</a> <a class="dropdown-item" href="/5.20.0/perlfaq">5.20.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.18.4/perlfaq">5.18.4</a> <a class="dropdown-item" href="/5.18.3/perlfaq">5.18.3</a> <a class="dropdown-item" href="/5.18.2/perlfaq">5.18.2</a> <a class="dropdown-item" href="/5.18.1/perlfaq">5.18.1</a> <a class="dropdown-item" href="/5.18.0/perlfaq">5.18.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.16.3/perlfaq">5.16.3</a> <a class="dropdown-item" href="/5.16.2/perlfaq">5.16.2</a> <a class="dropdown-item" href="/5.16.1/perlfaq">5.16.1</a> <a class="dropdown-item" href="/5.16.0/perlfaq">5.16.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.14.4/perlfaq">5.14.4</a> <a class="dropdown-item" href="/5.14.3/perlfaq">5.14.3</a> <a class="dropdown-item" href="/5.14.2/perlfaq">5.14.2</a> <a class="dropdown-item" href="/5.14.1/perlfaq">5.14.1</a> <a class="dropdown-item" href="/5.14.0/perlfaq">5.14.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.12.5/perlfaq">5.12.5</a> <a class="dropdown-item" href="/5.12.4/perlfaq">5.12.4</a> <a class="dropdown-item" href="/5.12.3/perlfaq">5.12.3</a> <a class="dropdown-item" href="/5.12.2/perlfaq">5.12.2</a> <a class="dropdown-item" href="/5.12.1/perlfaq">5.12.1</a> <a class="dropdown-item" href="/5.12.0/perlfaq">5.12.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.10.1/perlfaq">5.10.1</a> <a class="dropdown-item" href="/5.10.0/perlfaq">5.10.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.9/perlfaq">5.8.9</a> <a class="dropdown-item" href="/5.8.8/perlfaq">5.8.8</a> <a class="dropdown-item" href="/5.8.7/perlfaq">5.8.7</a> <a class="dropdown-item" href="/5.8.6/perlfaq">5.8.6</a> <a class="dropdown-item" href="/5.8.5/perlfaq">5.8.5</a> <a class="dropdown-item" href="/5.8.4/perlfaq">5.8.4</a> <a class="dropdown-item" href="/5.8.3/perlfaq">5.8.3</a> <a class="dropdown-item" href="/5.8.2/perlfaq">5.8.2</a> <a class="dropdown-item" href="/5.8.1/perlfaq">5.8.1</a> <a class="dropdown-item" href="/5.8.0/perlfaq">5.8.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/perlfaq">5.6.2</a> <a class="dropdown-item" href="/5.6.1/perlfaq">5.6.1</a> <a class="dropdown-item" href="/5.6.0/perlfaq">5.6.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.005_04/perlfaq">5.005_04</a> <a class="dropdown-item" href="/5.005_03/perlfaq">5.005_03</a> <a class="dropdown-item" href="/5.005_02/perlfaq">5.005_02</a> <a class="dropdown-item" href="/5.005_01/perlfaq">5.005_01</a> <a class="dropdown-item" href="/5.005/perlfaq">5.005</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-dev"> <a class="dropdown-item" href="/blead/perlfaq">blead</a> <a class="dropdown-item" href="/5.41.6/perlfaq">5.41.6</a> <a class="dropdown-item" href="/5.41.5/perlfaq">5.41.5</a> <a class="dropdown-item" href="/5.41.4/perlfaq">5.41.4</a> <a class="dropdown-item" href="/5.41.3/perlfaq">5.41.3</a> <a class="dropdown-item" href="/5.41.2/perlfaq">5.41.2</a> <a class="dropdown-item" href="/5.41.1/perlfaq">5.41.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.0-RC2/perlfaq">5.40.0-RC2</a> <a class="dropdown-item" href="/5.40.0-RC1/perlfaq">5.40.0-RC1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.39.10/perlfaq">5.39.10</a> <a class="dropdown-item" href="/5.39.9/perlfaq">5.39.9</a> <a class="dropdown-item" href="/5.39.8/perlfaq">5.39.8</a> <a class="dropdown-item" href="/5.39.7/perlfaq">5.39.7</a> <a class="dropdown-item" href="/5.39.6/perlfaq">5.39.6</a> <a class="dropdown-item" href="/5.39.5/perlfaq">5.39.5</a> <a class="dropdown-item" href="/5.39.4/perlfaq">5.39.4</a> <a class="dropdown-item" href="/5.39.3/perlfaq">5.39.3</a> <a class="dropdown-item" href="/5.39.2/perlfaq">5.39.2</a> <a class="dropdown-item" href="/5.39.1/perlfaq">5.39.1</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-nav"> <a class="dropdown-item" href="/perl">Perl</a> <a class="dropdown-item" href="/perlintro">Intro</a> <a class="dropdown-item" href="/perl#Tutorials">Tutorials</a> <a class="dropdown-item" href="/perlfaq">FAQs</a> <a class="dropdown-item" href="/perl#Reference-Manual">Reference</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/perlop">Operators</a> <a class="dropdown-item" href="/functions">Functions</a> <a class="dropdown-item" href="/variables">Variables</a> <a class="dropdown-item" href="/modules">Modules</a> <a class="dropdown-item" href="/perlutil">Utilities</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/perldelta">Release Notes</a> <a class="dropdown-item" href="/perlcommunity">Community</a> <a class="dropdown-item" href="/perlhist">History</a> </div> </li> </ul> <ul class="navbar-nav"> <script> function set_expand (expand) { var perldocdiv = document.getElementById('perldocdiv'); var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width'); var expanded = (width == '' || width == 'none') ? true : false; if (expand === null) { expand = !expanded; } if ((expand && !expanded) || (!expand && expanded)) { perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px'); var button_classlist = document.getElementById('content-expand-button').classList; if (expand) { button_classlist.add('btn-light'); button_classlist.remove('btn-outline-light'); } else { button_classlist.add('btn-outline-light'); button_classlist.remove('btn-light'); } } return expand; } function toggle_expand () { var expand = set_expand(null); document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC'; } function read_expand () { return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { if (read_expand()) { set_expand(true); } }); } else if (read_expand()) { set_expand(true); } </script> <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-4" onclick="toggle_expand()">Expand</button> </ul> <form class="form-inline" method="get" action="/search"> <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search" value=""> </form> </div> </nav> <div id="wrapperlicious" class="container-fluid"> <div id="perldocdiv"> <div id="links"> <a href="/perlfaq">perlfaq</a> <div id="more"> (<a href="/perlfaq.txt">source</a>, <a href="https://metacpan.org/pod/perlfaq">CPAN</a>) </div> <div id="moduleversion">version 5.20240218</div> </div> <h1><a id="toc">CONTENTS</a></h1> <ul> <li> <a class="text-decoration-none" href="#NAME">NAME</a> </li> <li> <a class="text-decoration-none" href="#VERSION">VERSION</a> </li> <li> <a class="text-decoration-none" href="#DESCRIPTION">DESCRIPTION</a> <ul> <li> <a class="text-decoration-none" href="#Where-to-find-the-perlfaq">Where to find the perlfaq</a> </li> <li> <a class="text-decoration-none" href="#How-to-use-the-perlfaq">How to use the perlfaq</a> </li> <li> <a class="text-decoration-none" href="#How-to-contribute-to-the-perlfaq">How to contribute to the perlfaq</a> </li> <li> <a class="text-decoration-none" href="#What-if-my-question-isn&#39;t-answered-in-the-FAQ?">What if my question isn&#39;t answered in the FAQ?</a> </li> </ul> </li> <li> <a class="text-decoration-none" href="#TABLE-OF-CONTENTS">TABLE OF CONTENTS</a> </li> <li> <a class="text-decoration-none" href="#THE-QUESTIONS">THE QUESTIONS</a> <ul> <li> <a class="text-decoration-none" href="#perlfaq1:-General-Questions-About-Perl">perlfaq1: General Questions About Perl</a> </li> <li> <a class="text-decoration-none" href="#perlfaq2:-Obtaining-and-Learning-about-Perl">perlfaq2: Obtaining and Learning about Perl</a> </li> <li> <a class="text-decoration-none" href="#perlfaq3:-Programming-Tools">perlfaq3: Programming Tools</a> </li> <li> <a class="text-decoration-none" href="#perlfaq4:-Data-Manipulation">perlfaq4: Data Manipulation</a> </li> <li> <a class="text-decoration-none" href="#perlfaq5:-Files-and-Formats">perlfaq5: Files and Formats</a> </li> <li> <a class="text-decoration-none" href="#perlfaq6:-Regular-Expressions">perlfaq6: Regular Expressions</a> </li> <li> <a class="text-decoration-none" href="#perlfaq7:-General-Perl-Language-Issues">perlfaq7: General Perl Language Issues</a> </li> <li> <a class="text-decoration-none" href="#perlfaq8:-System-Interaction">perlfaq8: System Interaction</a> </li> <li> <a class="text-decoration-none" href="#perlfaq9:-Web,-Email-and-Networking">perlfaq9: Web, Email and Networking</a> </li> </ul> </li> <li> <a class="text-decoration-none" href="#CREDITS">CREDITS</a> </li> <li> <a class="text-decoration-none" href="#AUTHOR-AND-COPYRIGHT">AUTHOR AND COPYRIGHT</a> </li> </ul> <h1 id="NAME"><a class="permalink" href="#NAME">#</a>NAME</h1> <p>perlfaq - Frequently asked questions about Perl</p> <h1 id="VERSION"><a class="permalink" href="#VERSION">#</a>VERSION</h1> <p>version 5.20240218</p> <h1 id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">#</a>DESCRIPTION</h1> <p>The perlfaq comprises several documents that answer the most commonly asked questions about Perl and Perl programming. It&#39;s divided by topic into nine major sections outlined in this document.</p> <h2 id="Where-to-find-the-perlfaq"><a class="permalink" href="#Where-to-find-the-perlfaq">#</a><a id="Where"></a>Where to find the perlfaq</h2> <p>The perlfaq is an evolving document. Read the latest version at <a href="https://perldoc.perl.org/perlfaq">https://perldoc.perl.org/perlfaq</a>. It is also included in the standard Perl distribution.</p> <h2 id="How-to-use-the-perlfaq"><a class="permalink" href="#How-to-use-the-perlfaq">#</a><a id="How"></a>How to use the perlfaq</h2> <p>The <code>perldoc</code> command line tool is part of the standard Perl distribution. To read the perlfaq:</p> <pre><code class="plaintext">$ perldoc perlfaq</code></pre> <p>To search the perlfaq question headings:</p> <pre><code class="plaintext">$ perldoc -q open</code></pre> <h2 id="How-to-contribute-to-the-perlfaq"><a class="permalink" href="#How-to-contribute-to-the-perlfaq">#</a><a id="How1"></a>How to contribute to the perlfaq</h2> <p>Review <a href="https://github.com/perl-doc-cats/perlfaq/wiki">https://github.com/perl-doc-cats/perlfaq/wiki</a>. If you don&#39;t find your suggestion create an issue or pull request against <a href="https://github.com/perl-doc-cats/perlfaq">https://github.com/perl-doc-cats/perlfaq</a>.</p> <p>Once approved, changes will be distributed with the next Perl release and subsequently appear at <a href="https://perldoc.perl.org/perlfaq">https://perldoc.perl.org/perlfaq</a>.</p> <h2 id="What-if-my-question-isn&#39;t-answered-in-the-FAQ?"><a class="permalink" href="#What-if-my-question-isn&#39;t-answered-in-the-FAQ?">#</a><a id="What"></a><a id="What-if-my-question-isnt-answered-in-the-FAQ"></a>What if my question isn&#39;t answered in the FAQ?</h2> <p>Try the resources in <a href="/perlfaq2">perlfaq2</a>.</p> <h1 id="TABLE-OF-CONTENTS"><a class="permalink" href="#TABLE-OF-CONTENTS">#</a><a id="TABLE"></a>TABLE OF CONTENTS</h1> <dl> <dt id="perlfaq1-General-Questions-About-Perl"><a class="permalink" href="#perlfaq1-General-Questions-About-Perl">#</a><a id="perlfaq1"></a><a id="perlfaq1---General-Questions-About-Perl"></a>perlfaq1 - General Questions About Perl</dt> <dd> </dd> <dt id="perlfaq2-Obtaining-and-Learning-about-Perl"><a class="permalink" href="#perlfaq2-Obtaining-and-Learning-about-Perl">#</a><a id="perlfaq2"></a><a id="perlfaq2---Obtaining-and-Learning-about-Perl"></a>perlfaq2 - Obtaining and Learning about Perl</dt> <dd> </dd> <dt id="perlfaq3-Programming-Tools"><a class="permalink" href="#perlfaq3-Programming-Tools">#</a><a id="perlfaq3"></a><a id="perlfaq3---Programming-Tools"></a>perlfaq3 - Programming Tools</dt> <dd> </dd> <dt id="perlfaq4-Data-Manipulation"><a class="permalink" href="#perlfaq4-Data-Manipulation">#</a><a id="perlfaq4"></a><a id="perlfaq4---Data-Manipulation"></a>perlfaq4 - Data Manipulation</dt> <dd> </dd> <dt id="perlfaq5-Files-and-Formats"><a class="permalink" href="#perlfaq5-Files-and-Formats">#</a><a id="perlfaq5"></a><a id="perlfaq5---Files-and-Formats"></a>perlfaq5 - Files and Formats</dt> <dd> </dd> <dt id="perlfaq6-Regular-Expressions"><a class="permalink" href="#perlfaq6-Regular-Expressions">#</a><a id="perlfaq6"></a><a id="perlfaq6---Regular-Expressions"></a>perlfaq6 - Regular Expressions</dt> <dd> </dd> <dt id="perlfaq7-General-Perl-Language-Issues"><a class="permalink" href="#perlfaq7-General-Perl-Language-Issues">#</a><a id="perlfaq7"></a><a id="perlfaq7---General-Perl-Language-Issues"></a>perlfaq7 - General Perl Language Issues</dt> <dd> </dd> <dt id="perlfaq8-System-Interaction"><a class="permalink" href="#perlfaq8-System-Interaction">#</a><a id="perlfaq8"></a><a id="perlfaq8---System-Interaction"></a>perlfaq8 - System Interaction</dt> <dd> </dd> <dt id="perlfaq9-Web,-Email-and-Networking"><a class="permalink" href="#perlfaq9-Web,-Email-and-Networking">#</a><a id="perlfaq9"></a><a id="perlfaq9---Web-Email-and-Networking"></a>perlfaq9 - Web, Email and Networking</dt> <dd> </dd> </dl> <h1 id="THE-QUESTIONS"><a class="permalink" href="#THE-QUESTIONS">#</a><a id="THE"></a>THE QUESTIONS</h1> <h2 id="perlfaq1:-General-Questions-About-Perl"><a class="permalink" href="#perlfaq1:-General-Questions-About-Perl">#</a><a id="perlfaq11"></a><a href="/perlfaq1">perlfaq1</a>: General Questions About Perl</h2> <p>This section of the FAQ answers 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 is Raku (Perl 6)?</p> </li> <li><p>How stable is Perl?</p> </li> <li><p>How often are new versions of Perl released?</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&#39;t I program in Perl?</p> </li> <li><p>What&#39;s the difference between &quot;perl&quot; and &quot;Perl&quot;?</p> </li> <li><p>What is a JAPH?</p> </li> <li><p>How can I convince others to use Perl?</p> </li> </ul> <h2 id="perlfaq2:-Obtaining-and-Learning-about-Perl"><a class="permalink" href="#perlfaq2:-Obtaining-and-Learning-about-Perl">#</a><a id="perlfaq21"></a><a href="/perlfaq2">perlfaq2</a>: Obtaining and Learning about Perl</h2> <p>This section of the FAQ answers questions about 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&#39;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&#39;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?</p> </li> <li><p>Where can I get information on Perl?</p> </li> <li><p>What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?</p> </li> <li><p>Where can I post questions?</p> </li> <li><p>Perl Books</p> </li> <li><p>Which magazines have Perl content?</p> </li> <li><p>Which Perl blogs should I read?</p> </li> <li><p>What mailing lists are there for Perl?</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> </ul> <h2 id="perlfaq3:-Programming-Tools"><a class="permalink" href="#perlfaq3:-Programming-Tools">#</a><a id="perlfaq31"></a><a href="/perlfaq3">perlfaq3</a>: Programming Tools</h2> <p>This section of the FAQ answers questions related to 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>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 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 or cperl-mode for emacs?</p> </li> <li><p>How can I use curses with Perl?</p> </li> <li><p>How can I write a GUI (X, Tk, Gtk, etc.) in 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 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&#39;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&#39;ve read perlembed, perlguts, etc., but I can&#39;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&#39;s MakeMaker?</p> </li> </ul> <h2 id="perlfaq4:-Data-Manipulation"><a class="permalink" href="#perlfaq4:-Data-Manipulation">#</a><a id="perlfaq41"></a><a href="/perlfaq4">perlfaq4</a>: Data Manipulation</h2> <p>This section of the FAQ answers questions related to 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 int() broken?</p> </li> <li><p>Why isn&#39;t my octal data interpreted correctly?</p> </li> <li><p>Does Perl have a round() function? What about ceil() and floor()? Trig functions?</p> </li> <li><p>How do I convert between numeric representations/bases/radixes?</p> </li> <li><p>Why doesn&#39;t &amp; work the way I want it to?</p> </li> <li><p>How do I multiply matrices?</p> </li> <li><p>How do I perform an operation on a series of integers?</p> </li> <li><p>How can I output Roman numerals?</p> </li> <li><p>Why aren&#39;t my random numbers random?</p> </li> <li><p>How do I get a random number between X and Y?</p> </li> <li><p>How do I find the day or week of the year?</p> </li> <li><p>How do I find the current century or millennium?</p> </li> <li><p>How can I compare two dates and find the difference?</p> </li> <li><p>How can I take a string and turn it into epoch seconds?</p> </li> <li><p>How can I find the Julian Day?</p> </li> <li><p>How do I find yesterday&#39;s date?</p> </li> <li><p>Does Perl have a Year 2000 or 2038 problem? Is Perl Y2K compliant?</p> </li> <li><p>How do I validate input?</p> </li> <li><p>How do I unescape a string?</p> </li> <li><p>How do I remove consecutive pairs of characters?</p> </li> <li><p>How do I expand function calls in a string?</p> </li> <li><p>How do I find matching/nesting anything?</p> </li> <li><p>How do I reverse a string?</p> </li> <li><p>How do I expand tabs in a string?</p> </li> <li><p>How do I reformat a paragraph?</p> </li> <li><p>How can I access or change N characters of a string?</p> </li> <li><p>How do I change the Nth occurrence of something?</p> </li> <li><p>How can I count the number of occurrences of a substring within a string?</p> </li> <li><p>How do I capitalize all the words on one line?</p> </li> <li><p>How can I split a [character]-delimited string except when inside [character]?</p> </li> <li><p>How do I strip blank space from the beginning/end of a string?</p> </li> <li><p>How do I pad a string with blanks or pad a number with zeroes?</p> </li> <li><p>How do I extract selected columns from a string?</p> </li> <li><p>How do I find the soundex value of a string?</p> </li> <li><p>How can I expand variables in text strings?</p> </li> <li><p>Does Perl have anything like Ruby&#39;s #{} or Python&#39;s f string?</p> </li> <li><p>What&#39;s wrong with always quoting &quot;$vars&quot;?</p> </li> <li><p>Why don&#39;t my &lt;&lt;HERE documents work?</p> </li> <li><p>What is the difference between a list and an array?</p> </li> <li><p>What is the difference between $array[1] and @array[1]?</p> </li> <li><p>How can I remove duplicate elements from a list or array?</p> </li> <li><p>How can I tell whether a certain element is contained in a list or array?</p> </li> <li><p>How do I compute the difference of two arrays? How do I compute the intersection of two arrays?</p> </li> <li><p>How do I test whether two arrays or hashes are equal?</p> </li> <li><p>How do I find the first array element for which a condition is true?</p> </li> <li><p>How do I handle linked lists?</p> </li> <li><p>How do I handle circular lists?</p> </li> <li><p>How do I shuffle an array randomly?</p> </li> <li><p>How do I process/modify each element of an array?</p> </li> <li><p>How do I select a random element from an array?</p> </li> <li><p>How do I permute N elements of a list?</p> </li> <li><p>How do I sort an array by (anything)?</p> </li> <li><p>How do I manipulate arrays of bits?</p> </li> <li><p>Why does defined() return true on empty arrays and hashes?</p> </li> <li><p>How do I process an entire hash?</p> </li> <li><p>How do I merge two hashes?</p> </li> <li><p>What happens if I add or remove keys from a hash while iterating over it?</p> </li> <li><p>How do I look up a hash element by value?</p> </li> <li><p>How can I know how many entries are in a hash?</p> </li> <li><p>How do I sort a hash (optionally by value instead of key)?</p> </li> <li><p>How can I always keep my hash sorted?</p> </li> <li><p>What&#39;s the difference between &quot;delete&quot; and &quot;undef&quot; with hashes?</p> </li> <li><p>Why don&#39;t my tied hashes make the defined/exists distinction?</p> </li> <li><p>How do I reset an each() operation part-way through?</p> </li> <li><p>How can I get the unique keys from two hashes?</p> </li> <li><p>How can I store a multidimensional array in a DBM file?</p> </li> <li><p>How can I make my hash remember the order I put elements into it?</p> </li> <li><p>Why does passing a subroutine an undefined element in a hash create it?</p> </li> <li><p>How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?</p> </li> <li><p>How can I use a reference as a hash key?</p> </li> <li><p>How can I check if a key exists in a multilevel hash?</p> </li> <li><p>How can I prevent addition of unwanted keys into a hash?</p> </li> <li><p>How do I handle binary data correctly?</p> </li> <li><p>How do I determine whether a scalar is a number/whole/integer/float?</p> </li> <li><p>How do I keep persistent data across program calls?</p> </li> <li><p>How do I print out or copy a recursive data structure?</p> </li> <li><p>How do I define methods for every class/object?</p> </li> <li><p>How do I verify a credit card checksum?</p> </li> <li><p>How do I pack arrays of doubles or floats for XS code?</p> </li> </ul> <h2 id="perlfaq5:-Files-and-Formats"><a class="permalink" href="#perlfaq5:-Files-and-Formats">#</a><a id="perlfaq51"></a><a href="/perlfaq5">perlfaq5</a>: Files and Formats</h2> <p>This section deals with I/O and the &quot;f&quot; issues: filehandles, flushing, formats, and footers.</p> <ul> <li><p>How do I flush/unbuffer an output filehandle? Why must I do this?</p> </li> <li><p>How do I change, delete, or insert a line in a file, or append to the beginning of a file?</p> </li> <li><p>How do I count the number of lines in a file?</p> </li> <li><p>How do I delete the last N lines from a file?</p> </li> <li><p>How can I use Perl&#39;s <code>-i</code> option from within a program?</p> </li> <li><p>How can I copy a file?</p> </li> <li><p>How do I make a temporary file name?</p> </li> <li><p>How can I manipulate fixed-record-length files?</p> </li> <li><p>How can I make a filehandle local to a subroutine? How do I pass filehandles between subroutines? How do I make an array of filehandles?</p> </li> <li><p>How can I use a filehandle indirectly?</p> </li> <li><p>How can I open a filehandle to a string?</p> </li> <li><p>How can I set up a footer format to be used with write()?</p> </li> <li><p>How can I write() into a string?</p> </li> <li><p>How can I output my numbers with commas added?</p> </li> <li><p>How can I translate tildes (~) in a filename?</p> </li> <li><p>When I open a file read-write, why does it wipe it out?</p> </li> <li><p>Why do I sometimes get an &quot;Argument list too long&quot; when I use &lt;*&gt;?</p> </li> <li><p>How can I open a file named with a leading &quot;&gt;&quot; or trailing blanks?</p> </li> <li><p>How can I reliably rename a file?</p> </li> <li><p>How can I lock a file?</p> </li> <li><p>Why can&#39;t I just open(FH, &quot;&gt;file.lock&quot;)?</p> </li> <li><p>I still don&#39;t get locking. I just want to increment the number in the file. How can I do this?</p> </li> <li><p>All I want to do is append a small amount of text to the end of a file. Do I still have to use locking?</p> </li> <li><p>How do I randomly update a binary file?</p> </li> <li><p>How do I get a file&#39;s timestamp in perl?</p> </li> <li><p>How do I set a file&#39;s timestamp in perl?</p> </li> <li><p>How do I print to more than one file at once?</p> </li> <li><p>How can I read in an entire file all at once?</p> </li> <li><p>How can I read in a file by paragraphs?</p> </li> <li><p>How can I read a single character from a file? From the keyboard?</p> </li> <li><p>How can I tell whether there&#39;s a character waiting on a filehandle?</p> </li> <li><p>How do I do a <code>tail -f</code> in perl?</p> </li> <li><p>How do I dup() a filehandle in Perl?</p> </li> <li><p>How do I close a file descriptor by number?</p> </li> <li><p>Why can&#39;t I use &quot;C:\temp\foo&quot; in DOS paths? Why doesn&#39;t `C:\temp\foo.exe` work?</p> </li> <li><p>Why doesn&#39;t glob(&quot;*.*&quot;) get all the files?</p> </li> <li><p>Why does Perl let me delete read-only files? Why does <code>-i</code> clobber protected files? Isn&#39;t this a bug in Perl?</p> </li> <li><p>How do I select a random line from a file?</p> </li> <li><p>Why do I get weird spaces when I print an array of lines?</p> </li> <li><p>How do I traverse a directory tree?</p> </li> <li><p>How do I delete a directory tree?</p> </li> <li><p>How do I copy an entire directory?</p> </li> </ul> <h2 id="perlfaq6:-Regular-Expressions"><a class="permalink" href="#perlfaq6:-Regular-Expressions">#</a><a id="perlfaq61"></a><a href="/perlfaq6">perlfaq6</a>: Regular Expressions</h2> <p>This section is surprisingly small because the rest of the FAQ is littered with answers involving regular expressions. For example, decoding a URL and checking whether something is a number can be handled with regular expressions, but those answers are found elsewhere in this document (in perlfaq9 : &quot;How do I decode or create those %-encodings on the web&quot; and perlfaq4 : &quot;How do I determine whether a scalar is a number/whole/integer/float&quot;, to be precise).</p> <ul> <li><p>How can I hope to use regular expressions without creating illegible and unmaintainable code?</p> </li> <li><p>I&#39;m having trouble matching over more than one line. What&#39;s wrong?</p> </li> <li><p>How can I pull out lines between two patterns that are themselves on different lines?</p> </li> <li><p>How do I match XML, HTML, or other nasty, ugly things with a regex?</p> </li> <li><p>I put a regular expression into $/ but it didn&#39;t work. What&#39;s wrong?</p> </li> <li><p>How do I substitute case-insensitively on the LHS while preserving case on the RHS?</p> </li> <li><p>How can I make <code>\w</code> match national character sets?</p> </li> <li><p>How can I match a locale-smart version of <code>/[a-zA-Z]/</code> ?</p> </li> <li><p>How can I quote a variable to use in a regex?</p> </li> <li><p>What is <code>/o</code> really for?</p> </li> <li><p>How do I use a regular expression to strip C-style comments from a file?</p> </li> <li><p>Can I use Perl regular expressions to match balanced text?</p> </li> <li><p>What does it mean that regexes are greedy? How can I get around it?</p> </li> <li><p>How do I process each word on each line?</p> </li> <li><p>How can I print out a word-frequency or line-frequency summary?</p> </li> <li><p>How can I do approximate matching?</p> </li> <li><p>How do I efficiently match many regular expressions at once?</p> </li> <li><p>Why don&#39;t word-boundary searches with <code>\b</code> work for me?</p> </li> <li><p>Why does using $&amp;, $`, or $&#39; slow my program down?</p> </li> <li><p>What good is <code>\G</code> in a regular expression?</p> </li> <li><p>Are Perl regexes DFAs or NFAs? Are they POSIX compliant?</p> </li> <li><p>What&#39;s wrong with using grep in a void context?</p> </li> <li><p>How can I match strings with multibyte characters?</p> </li> <li><p>How do I match a regular expression that&#39;s in a variable?</p> </li> </ul> <h2 id="perlfaq7:-General-Perl-Language-Issues"><a class="permalink" href="#perlfaq7:-General-Perl-Language-Issues">#</a><a id="perlfaq71"></a><a href="/perlfaq7">perlfaq7</a>: General Perl Language Issues</h2> <p>This section deals with general Perl language issues that don&#39;t clearly fit into any of the other sections.</p> <ul> <li><p>Can I get a BNF/yacc/RE for the Perl language?</p> </li> <li><p>What are all these $@%&amp;* punctuation signs, and how do I know when to use them?</p> </li> <li><p>Do I always/never have to quote my strings or use semicolons and commas?</p> </li> <li><p>How do I skip some return values?</p> </li> <li><p>How do I temporarily block warnings?</p> </li> <li><p>What&#39;s an extension?</p> </li> <li><p>Why do Perl operators have different precedence than C operators?</p> </li> <li><p>How do I declare/create a structure?</p> </li> <li><p>How do I create a module?</p> </li> <li><p>How do I adopt or take over a module already on CPAN?</p> </li> <li><p>How do I create a class?</p> </li> <li><p>How can I tell if a variable is tainted?</p> </li> <li><p>What&#39;s a closure?</p> </li> <li><p>What is variable suicide and how can I prevent it?</p> </li> <li><p>How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?</p> </li> <li><p>How do I create a static variable?</p> </li> <li><p>What&#39;s the difference between dynamic and lexical (static) scoping? Between local() and my()?</p> </li> <li><p>How can I access a dynamic variable while a similarly named lexical is in scope?</p> </li> <li><p>What&#39;s the difference between deep and shallow binding?</p> </li> <li><p>Why doesn&#39;t &quot;my($foo) = &lt;$fh&gt;;&quot; work right?</p> </li> <li><p>How do I redefine a builtin function, operator, or method?</p> </li> <li><p>What&#39;s the difference between calling a function as &amp;foo and foo()?</p> </li> <li><p>How do I create a switch or case statement?</p> </li> <li><p>How can I catch accesses to undefined variables, functions, or methods?</p> </li> <li><p>Why can&#39;t a method included in this same file be found?</p> </li> <li><p>How can I find out my current or calling package?</p> </li> <li><p>How can I comment out a large block of Perl code?</p> </li> <li><p>How do I clear a package?</p> </li> <li><p>How can I use a variable as a variable name?</p> </li> <li><p>What does &quot;bad interpreter&quot; mean?</p> </li> <li><p>Do I need to recompile XS modules when there is a change in the C library?</p> </li> </ul> <h2 id="perlfaq8:-System-Interaction"><a class="permalink" href="#perlfaq8:-System-Interaction">#</a><a id="perlfaq81"></a><a href="/perlfaq8">perlfaq8</a>: System Interaction</h2> <p>This section of the Perl FAQ covers questions involving operating system interaction. Topics include interprocess communication (IPC), control over the user-interface (keyboard, screen and pointing devices), and most anything else not related to data manipulation.</p> <ul> <li><p>How do I find out which operating system I&#39;m running under?</p> </li> <li><p>Why does exec() not return?</p> </li> <li><p>How do I do fancy stuff with the keyboard/screen/mouse?</p> </li> <li><p>How do I print something out in color?</p> </li> <li><p>How do I read just one key without waiting for a return key?</p> </li> <li><p>How do I check whether input is ready on the keyboard?</p> </li> <li><p>How do I clear the screen?</p> </li> <li><p>How do I get the screen size?</p> </li> <li><p>How do I ask the user for a password?</p> </li> <li><p>How do I read and write the serial port?</p> </li> <li><p>How do I decode encrypted password files?</p> </li> <li><p>How do I start a process in the background?</p> </li> <li><p>How do I trap control characters/signals?</p> </li> <li><p>How do I modify the shadow password file on a Unix system?</p> </li> <li><p>How do I set the time and date?</p> </li> <li><p>How can I sleep() or alarm() for under a second?</p> </li> <li><p>How can I measure time under a second?</p> </li> <li><p>How can I do an atexit() or setjmp()/longjmp()? (Exception handling)</p> </li> <li><p>Why doesn&#39;t my sockets program work under System V (Solaris)? What does the error message &quot;Protocol not supported&quot; mean?</p> </li> <li><p>How can I call my system&#39;s unique C functions from Perl?</p> </li> <li><p>Where do I get the include files to do ioctl() or syscall()?</p> </li> <li><p>Why do setuid perl scripts complain about kernel problems?</p> </li> <li><p>How can I open a pipe both to and from a command?</p> </li> <li><p>Why can&#39;t I get the output of a command with system()?</p> </li> <li><p>How can I capture STDERR from an external command?</p> </li> <li><p>Why doesn&#39;t open() return an error when a pipe open fails?</p> </li> <li><p>What&#39;s wrong with using backticks in a void context?</p> </li> <li><p>How can I call backticks without shell processing?</p> </li> <li><p>Why can&#39;t my script read from STDIN after I gave it EOF (^D on Unix, ^Z on MS-DOS)?</p> </li> <li><p>How can I convert my shell script to perl?</p> </li> <li><p>Can I use perl to run a telnet or ftp session?</p> </li> <li><p>How can I write expect in Perl?</p> </li> <li><p>Is there a way to hide perl&#39;s command line from programs such as &quot;ps&quot;?</p> </li> <li><p>I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?</p> </li> <li><p>How do I close a process&#39;s filehandle without waiting for it to complete?</p> </li> <li><p>How do I fork a daemon process?</p> </li> <li><p>How do I find out if I&#39;m running interactively or not?</p> </li> <li><p>How do I timeout a slow event?</p> </li> <li><p>How do I set CPU limits?</p> </li> <li><p>How do I avoid zombies on a Unix system?</p> </li> <li><p>How do I use an SQL database?</p> </li> <li><p>How do I make a system() exit on control-C?</p> </li> <li><p>How do I open a file without blocking?</p> </li> <li><p>How do I tell the difference between errors from the shell and perl?</p> </li> <li><p>How do I install a module from CPAN?</p> </li> <li><p>What&#39;s the difference between require and use?</p> </li> <li><p>How do I keep my own module/library directory?</p> </li> <li><p>How do I add the directory my program lives in to the module/library search path?</p> </li> <li><p>How do I add a directory to my include path (@INC) at runtime?</p> </li> <li><p>Where are modules installed?</p> </li> <li><p>What is socket.ph and where do I get it?</p> </li> </ul> <h2 id="perlfaq9:-Web,-Email-and-Networking"><a class="permalink" href="#perlfaq9:-Web,-Email-and-Networking">#</a><a id="perlfaq91"></a><a id="perlfaq9:-Web-Email-and-Networking"></a><a href="/perlfaq9">perlfaq9</a>: Web, Email and Networking</h2> <p>This section deals with questions related to running web sites, sending and receiving email as well as general networking.</p> <ul> <li><p>Should I use a web framework?</p> </li> <li><p>Which web framework should I use?</p> </li> <li><p>What is Plack and PSGI?</p> </li> <li><p>How do I remove HTML from a string?</p> </li> <li><p>How do I extract URLs?</p> </li> <li><p>How do I fetch an HTML file?</p> </li> <li><p>How do I automate an HTML form submission?</p> </li> <li><p>How do I decode or create those %-encodings on the web?</p> </li> <li><p>How do I redirect to another page?</p> </li> <li><p>How do I put a password on my web pages?</p> </li> <li><p>How do I make sure users can&#39;t enter values into a form that causes my CGI script to do bad things?</p> </li> <li><p>How do I parse a mail header?</p> </li> <li><p>How do I check a valid mail address?</p> </li> <li><p>How do I decode a MIME/BASE64 string?</p> </li> <li><p>How do I find the user&#39;s mail address?</p> </li> <li><p>How do I send email?</p> </li> <li><p>How do I use MIME to make an attachment to a mail message?</p> </li> <li><p>How do I read email?</p> </li> <li><p>How do I find out my hostname, domainname, or IP address?</p> </li> <li><p>How do I fetch/put an (S)FTP file?</p> </li> <li><p>How can I do RPC in Perl?</p> </li> </ul> <h1 id="CREDITS"><a class="permalink" href="#CREDITS">#</a>CREDITS</h1> <p>Tom Christiansen wrote the original perlfaq then expanded it with the help of Nat Torkington. brian d foy substantially edited and expanded the perlfaq. perlfaq-workers and others have also supplied feedback, patches and corrections over the years.</p> <h1 id="AUTHOR-AND-COPYRIGHT"><a class="permalink" href="#AUTHOR-AND-COPYRIGHT">#</a><a id="AUTHOR"></a>AUTHOR AND COPYRIGHT</h1> <p>Tom Christiansen wrote the original version of this document. brian d foy <code>&lt;bdfoy@cpan.org&gt;</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> </div> <div id="footer"> <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p> <p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> <script src="/highlight.pack.js"></script> <script>hljs.highlightAll();</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10