CINXE.COM

Perl Documentation - 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>Perl Documentation - Perldoc Browser</title> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser"> <link rel="canonical" href="https://perldoc.perl.org/"> <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.6.0</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-stable"> <a class="dropdown-item" href="/">Latest</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.0/">5.40.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.2/">5.38.2</a> <a class="dropdown-item" href="/5.38.1/">5.38.1</a> <a class="dropdown-item" href="/5.38.0/">5.38.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.36.3/">5.36.3</a> <a class="dropdown-item" href="/5.36.2/">5.36.2</a> <a class="dropdown-item" href="/5.36.1/">5.36.1</a> <a class="dropdown-item" href="/5.36.0/">5.36.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.34.3/">5.34.3</a> <a class="dropdown-item" href="/5.34.2/">5.34.2</a> <a class="dropdown-item" href="/5.34.1/">5.34.1</a> <a class="dropdown-item" href="/5.34.0/">5.34.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.32.1/">5.32.1</a> <a class="dropdown-item" href="/5.32.0/">5.32.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.30.3/">5.30.3</a> <a class="dropdown-item" href="/5.30.2/">5.30.2</a> <a class="dropdown-item" href="/5.30.1/">5.30.1</a> <a class="dropdown-item" href="/5.30.0/">5.30.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.28.3/">5.28.3</a> <a class="dropdown-item" href="/5.28.2/">5.28.2</a> <a class="dropdown-item" href="/5.28.1/">5.28.1</a> <a class="dropdown-item" href="/5.28.0/">5.28.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.26.3/">5.26.3</a> <a class="dropdown-item" href="/5.26.2/">5.26.2</a> <a class="dropdown-item" href="/5.26.1/">5.26.1</a> <a class="dropdown-item" href="/5.26.0/">5.26.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.24.4/">5.24.4</a> <a class="dropdown-item" href="/5.24.3/">5.24.3</a> <a class="dropdown-item" href="/5.24.2/">5.24.2</a> <a class="dropdown-item" href="/5.24.1/">5.24.1</a> <a class="dropdown-item" href="/5.24.0/">5.24.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.22.4/">5.22.4</a> <a class="dropdown-item" href="/5.22.3/">5.22.3</a> <a class="dropdown-item" href="/5.22.2/">5.22.2</a> <a class="dropdown-item" href="/5.22.1/">5.22.1</a> <a class="dropdown-item" href="/5.22.0/">5.22.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.20.3/">5.20.3</a> <a class="dropdown-item" href="/5.20.2/">5.20.2</a> <a class="dropdown-item" href="/5.20.1/">5.20.1</a> <a class="dropdown-item" href="/5.20.0/">5.20.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.18.4/">5.18.4</a> <a class="dropdown-item" href="/5.18.3/">5.18.3</a> <a class="dropdown-item" href="/5.18.2/">5.18.2</a> <a class="dropdown-item" href="/5.18.1/">5.18.1</a> <a class="dropdown-item" href="/5.18.0/">5.18.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.16.3/">5.16.3</a> <a class="dropdown-item" href="/5.16.2/">5.16.2</a> <a class="dropdown-item" href="/5.16.1/">5.16.1</a> <a class="dropdown-item" href="/5.16.0/">5.16.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.14.4/">5.14.4</a> <a class="dropdown-item" href="/5.14.3/">5.14.3</a> <a class="dropdown-item" href="/5.14.2/">5.14.2</a> <a class="dropdown-item" href="/5.14.1/">5.14.1</a> <a class="dropdown-item" href="/5.14.0/">5.14.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.12.5/">5.12.5</a> <a class="dropdown-item" href="/5.12.4/">5.12.4</a> <a class="dropdown-item" href="/5.12.3/">5.12.3</a> <a class="dropdown-item" href="/5.12.2/">5.12.2</a> <a class="dropdown-item" href="/5.12.1/">5.12.1</a> <a class="dropdown-item" href="/5.12.0/">5.12.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.10.1/">5.10.1</a> <a class="dropdown-item" href="/5.10.0/">5.10.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.9/">5.8.9</a> <a class="dropdown-item" href="/5.8.8/">5.8.8</a> <a class="dropdown-item" href="/5.8.7/">5.8.7</a> <a class="dropdown-item" href="/5.8.6/">5.8.6</a> <a class="dropdown-item" href="/5.8.5/">5.8.5</a> <a class="dropdown-item" href="/5.8.4/">5.8.4</a> <a class="dropdown-item" href="/5.8.3/">5.8.3</a> <a class="dropdown-item" href="/5.8.2/">5.8.2</a> <a class="dropdown-item" href="/5.8.1/">5.8.1</a> <a class="dropdown-item" href="/5.8.0/">5.8.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/">5.6.2</a> <a class="dropdown-item" href="/5.6.1/">5.6.1</a> <a class="dropdown-item active" href="/5.6.0/">5.6.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.005_04/">5.005_04</a> <a class="dropdown-item" href="/5.005_03/">5.005_03</a> <a class="dropdown-item" href="/5.005_02/">5.005_02</a> <a class="dropdown-item" href="/5.005_01/">5.005_01</a> <a class="dropdown-item" href="/5.005/">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/">blead</a> <a class="dropdown-item" href="/5.41.6/">5.41.6</a> <a class="dropdown-item" href="/5.41.5/">5.41.5</a> <a class="dropdown-item" href="/5.41.4/">5.41.4</a> <a class="dropdown-item" href="/5.41.3/">5.41.3</a> <a class="dropdown-item" href="/5.41.2/">5.41.2</a> <a class="dropdown-item" href="/5.41.1/">5.41.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.0-RC2/">5.40.0-RC2</a> <a class="dropdown-item" href="/5.40.0-RC1/">5.40.0-RC1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.39.10/">5.39.10</a> <a class="dropdown-item" href="/5.39.9/">5.39.9</a> <a class="dropdown-item" href="/5.39.8/">5.39.8</a> <a class="dropdown-item" href="/5.39.7/">5.39.7</a> <a class="dropdown-item" href="/5.39.6/">5.39.6</a> <a class="dropdown-item" href="/5.39.5/">5.39.5</a> <a class="dropdown-item" href="/5.39.4/">5.39.4</a> <a class="dropdown-item" href="/5.39.3/">5.39.3</a> <a class="dropdown-item" href="/5.39.2/">5.39.2</a> <a class="dropdown-item" href="/5.39.1/">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="/5.6.0/perl">Perl</a> <a class="dropdown-item" href="/5.6.0/perlintro">Intro</a> <a class="dropdown-item" href="/5.6.0/perl#Tutorials">Tutorials</a> <a class="dropdown-item" href="/5.6.0/perlfaq">FAQs</a> <a class="dropdown-item" href="/5.6.0/perl#Reference-Manual">Reference</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.0/perlop">Operators</a> <a class="dropdown-item" href="/5.6.0/functions">Functions</a> <a class="dropdown-item" href="/5.6.0/variables">Variables</a> <a class="dropdown-item" href="/5.6.0/modules">Modules</a> <a class="dropdown-item" href="/5.6.0/perlutil">Utilities</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.0/perldelta">Release Notes</a> <a class="dropdown-item" href="/5.6.0/perlcommunity">Community</a> <a class="dropdown-item" href="/5.6.0/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="/5.6.0/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 class="leading-notice"> You are viewing the version of this documentation from Perl 5.6.0. <a href="/">View the latest version</a> </div> <h1 id="Perl-5.6.0-Documentation"><a class="permalink" href="#Perl-5.6.0-Documentation">#</a><a id="Perl"></a>Perl 5.6.0 Documentation</h1> <p>For ease of access, the Perl manual has been split up into several sections:</p> <pre><code class="nohighlight">perl Perl overview (this section) <a href="/5.6.0/perldelta">perldelta</a> Perl changes since previous version <a href="/5.6.0/perl5005delta">perl5005delta</a> Perl changes in version 5.005 <a href="/5.6.0/perl5004delta">perl5004delta</a> Perl changes in version 5.004 <a href="/5.6.0/perlfaq">perlfaq</a> Perl frequently asked questions <a href="/5.6.0/perltoc">perltoc</a> Perl documentation table of contents <a href="/5.6.0/perldata">perldata</a> Perl data structures <a href="/5.6.0/perlsyn">perlsyn</a> Perl syntax <a href="/5.6.0/perlop">perlop</a> Perl operators and precedence <a href="/5.6.0/perlre">perlre</a> Perl regular expressions <a href="/5.6.0/perlrun">perlrun</a> Perl execution and options <a href="/5.6.0/perlfunc">perlfunc</a> Perl builtin functions <a href="/5.6.0/perlopentut">perlopentut</a> Perl open() tutorial <a href="/5.6.0/perlvar">perlvar</a> Perl predefined variables <a href="/5.6.0/perlsub">perlsub</a> Perl subroutines <a href="/5.6.0/perlmod">perlmod</a> Perl modules: how they work <a href="/5.6.0/perlmodlib">perlmodlib</a> Perl modules: how to write and use <a href="/5.6.0/perlmodinstall">perlmodinstall</a> Perl modules: how to install from CPAN <a href="/5.6.0/perlform">perlform</a> Perl formats <a href="/5.6.0/perlunicode">perlunicode</a> Perl unicode support <a href="/5.6.0/perllocale">perllocale</a> Perl locale support <a href="/5.6.0/perlreftut">perlreftut</a> Perl references short introduction <a href="/5.6.0/perlref">perlref</a> Perl references, the rest of the story <a href="/5.6.0/perldsc">perldsc</a> Perl data structures intro <a href="/5.6.0/perllol">perllol</a> Perl data structures: arrays of arrays <a href="/5.6.0/perlboot">perlboot</a> Perl OO tutorial for beginners <a href="/5.6.0/perltoot">perltoot</a> Perl OO tutorial, part 1 <a href="/5.6.0/perltootc">perltootc</a> Perl OO tutorial, part 2 <a href="/5.6.0/perlobj">perlobj</a> Perl objects <a href="/5.6.0/perltie">perltie</a> Perl objects hidden behind simple variables <a href="/5.6.0/perlbot">perlbot</a> Perl OO tricks and examples <a href="/5.6.0/perlipc">perlipc</a> Perl interprocess communication <a href="/5.6.0/perlfork">perlfork</a> Perl fork() information <a href="/5.6.0/perlthrtut">perlthrtut</a> Perl threads tutorial <a href="/5.6.0/perllexwarn">perllexwarn</a> Perl warnings and their control <a href="/5.6.0/perlfilter">perlfilter</a> Perl source filters <a href="/5.6.0/perldbmfilter">perldbmfilter</a> Perl DBM filters <a href="/5.6.0/perlcompile">perlcompile</a> Perl compiler suite intro <a href="/5.6.0/perldebug">perldebug</a> Perl debugging <a href="/5.6.0/perldiag">perldiag</a> Perl diagnostic messages <a href="/5.6.0/perlnumber">perlnumber</a> Perl number semantics <a href="/5.6.0/perlsec">perlsec</a> Perl security <a href="/5.6.0/perltrap">perltrap</a> Perl traps for the unwary <a href="/5.6.0/perlport">perlport</a> Perl portability guide <a href="/5.6.0/perlstyle">perlstyle</a> Perl style guide <a href="/5.6.0/perlpod">perlpod</a> Perl plain old documentation <a href="/5.6.0/perlbook">perlbook</a> Perl book information <a href="/5.6.0/perlembed">perlembed</a> Perl ways to embed perl in your C or C++ application <a href="/5.6.0/perlapio">perlapio</a> Perl internal IO abstraction interface <a href="/5.6.0/perldebguts">perldebguts</a> Perl debugging guts and tips <a href="/5.6.0/perlxs">perlxs</a> Perl XS application programming interface <a href="/5.6.0/perlxstut">perlxstut</a> Perl XS tutorial <a href="/5.6.0/perlguts">perlguts</a> Perl internal functions for those doing extensions <a href="/5.6.0/perlcall">perlcall</a> Perl calling conventions from C <a href="/5.6.0/perlapi">perlapi</a> Perl API listing (autogenerated) <a href="/5.6.0/perlintern">perlintern</a> Perl internal functions (autogenerated) <a href="/5.6.0/perltodo">perltodo</a> Perl things to do <a href="/5.6.0/perlhack">perlhack</a> Perl hackers guide <a href="/5.6.0/perlhist">perlhist</a> Perl history records <a href="/5.6.0/perlamiga">perlamiga</a> Perl notes for Amiga <a href="/5.6.0/perlcygwin">perlcygwin</a> Perl notes for Cygwin <a href="/5.6.0/perldos">perldos</a> Perl notes for DOS <a href="/5.6.0/perlhpux">perlhpux</a> Perl notes for HP-UX <a href="/5.6.0/perlmachten">perlmachten</a> Perl notes for Power MachTen <a href="/5.6.0/perlos2">perlos2</a> Perl notes for OS/2 <a href="/5.6.0/perlos390">perlos390</a> Perl notes for OS/390 <a href="/5.6.0/perlvms">perlvms</a> Perl notes for VMS <a href="/5.6.0/perlwin32">perlwin32</a> Perl notes for Windows</code></pre> <p>(If you&#39;re intending to read these straight through for the first time, the suggested order will tend to reduce the number of forward references.)</p> <p>By default, the manpages listed above are installed in the <i>/usr/local/man/</i> directory.</p> <p>Extensive additional documentation for Perl modules is available. The default configuration for perl will place this additional documentation in the <i>/usr/local/lib/perl5/man</i> directory (or else in the <i>man</i> subdirectory of the Perl library directory). Some of this additional documentation is distributed standard with Perl, but you&#39;ll also find documentation for third-party modules there.</p> <p>You should be able to view Perl&#39;s documentation with your man(1) program by including the proper directories in the appropriate start-up files, or in the MANPATH environment variable. To find out where the configuration has installed the manpages, type:</p> <pre><code class="nohighlight">perl -V:man.dir</code></pre> <p>If the directories have a common stem, such as <i>/usr/local/man/man1</i> and <i>/usr/local/man/man3</i>, you need only to add that stem (<i>/usr/local/man</i>) to your man(1) configuration files or your MANPATH environment variable. If they do not share a stem, you&#39;ll have to add both stems.</p> <p>If that doesn&#39;t work for some reason, you can still use the supplied <i>perldoc</i> script to view module information. You might also look into getting a replacement man program.</p> <p>If something strange has gone wrong with your program and you&#39;re not sure where you should look for help, try the <b>-w</b> switch first. It will often point out exactly where the trouble is.</p> <p><i>Full perl(1) documentation: <a href="/5.6.0/perl">perl</a></i></p> <h2 id="Reference-Lists"><a class="permalink" href="#Reference-Lists">#</a><a id="Reference"></a>Reference Lists</h2> <ul> <li><p><a href="/5.6.0/perlop">Operators</a></p> </li> <li><p><a href="/5.6.0/functions">Functions</a></p> </li> <li><p><a href="/5.6.0/variables">Variables</a></p> </li> <li><p><a href="/5.6.0/modules">Modules</a></p> </li> <li><p><a href="/5.6.0/perlutil">Utilities</a></p> </li> </ul> <h2 id="More-Info"><a class="permalink" href="#More-Info">#</a><a id="More"></a>More Info</h2> <ul> <li><p><a href="/5.6.0/perldelta">Perl 5.6.0 Release Notes</a></p> </li> <li><p><a href="/5.6.0/perlcommunity">Community</a></p> </li> <li><p><a href="/5.6.0/perlfaq">FAQs</a></p> </li> </ul> <h2 id="About-Perl"><a class="permalink" href="#About-Perl">#</a><a id="About"></a>About Perl</h2> <p>Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It&#39;s also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).</p> <p>Perl combines (in the author&#39;s opinion, anyway) some of the best features of C, <b>sed</b>, <b>awk</b>, and <b>sh</b>, so people familiar with those languages should have little difficulty with it. (Language historians will also note some vestiges of <b>csh</b>, Pascal, and even BASIC-PLUS.) Expression syntax corresponds closely to C expression syntax. Unlike most Unix utilities, Perl does not arbitrarily limit the size of your data--if you&#39;ve got the memory, Perl can slurp in your whole file as a single string. Recursion is of unlimited depth. And the tables used by hashes (sometimes called &quot;associative arrays&quot;) grow as necessary to prevent degraded performance. Perl can use sophisticated pattern matching techniques to scan large amounts of data quickly. Although optimized for scanning text, Perl can also deal with binary data, and can make dbm files look like hashes. Setuid Perl scripts are safer than C programs through a dataflow tracing mechanism that prevents many stupid security holes.</p> <p>If you have a problem that would ordinarily use <b>sed</b> or <b>awk</b> or <b>sh</b>, but it exceeds their capabilities or must run a little faster, and you don&#39;t want to write the silly thing in C, then Perl may be for you. There are also translators to turn your <b>sed</b> and <b>awk</b> scripts into Perl scripts.</p> <p>But wait, there&#39;s more...</p> <p>Begun in 1993 (see <a href="/5.6.0/perlhist">perlhist</a>), Perl version 5 is nearly a complete rewrite that provides the following additional benefits:</p> <ul> <li><p>modularity and reusability using innumerable modules</p> <p>Described in <a href="/5.6.0/perlmod">perlmod</a>, <a href="/5.6.0/perlmodlib">perlmodlib</a>, and <a href="/5.6.0/perlmodinstall">perlmodinstall</a>.</p> </li> <li><p>embeddable and extensible</p> <p>Described in <a href="/5.6.0/perlembed">perlembed</a>, <a href="/5.6.0/perlxstut">perlxstut</a>, <a href="/5.6.0/perlxs">perlxs</a>, <a href="/5.6.0/perlcall">perlcall</a>, <a href="/5.6.0/perlguts">perlguts</a>, and <a href="/5.6.0/xsubpp">xsubpp</a>.</p> </li> <li><p>roll-your-own magic variables (including multiple simultaneous DBM implementations)</p> <p>Described in <a href="/5.6.0/perltie">perltie</a> and <a href="/5.6.0/AnyDBM_File">AnyDBM_File</a>.</p> </li> <li><p>subroutines can now be overridden, autoloaded, and prototyped</p> <p>Described in <a href="/5.6.0/perlsub">perlsub</a>.</p> </li> <li><p>arbitrarily nested data structures and anonymous functions</p> <p>Described in <a href="/5.6.0/perlreftut">perlreftut</a>, <a href="/5.6.0/perlref">perlref</a>, <a href="/5.6.0/perldsc">perldsc</a>, and <a href="/5.6.0/perllol">perllol</a>.</p> </li> <li><p>object-oriented programming</p> <p>Described in <a href="/5.6.0/perlobj">perlobj</a>, <a href="/5.6.0/perltoot">perltoot</a>, and <a href="/5.6.0/perlbot">perlbot</a>.</p> </li> <li><p>compilability into C code or Perl bytecode</p> <p>Described in <a href="/5.6.0/B">B</a> and <a href="/5.6.0/B::Bytecode">B::Bytecode</a>.</p> </li> <li><p>support for light-weight processes (threads)</p> <p>Described in <a href="/5.6.0/perlthrtut">perlthrtut</a> and <a href="/5.6.0/Thread">Thread</a>.</p> </li> <li><p>support for internationalization, localization, and Unicode</p> <p>Described in <a href="/5.6.0/perllocale">perllocale</a> and <a href="/5.6.0/utf8">utf8</a>.</p> </li> <li><p>lexical scoping</p> <p>Described in <a href="/5.6.0/perlsub">perlsub</a>.</p> </li> <li><p>regular expression enhancements</p> <p>Described in <a href="/5.6.0/perlre">perlre</a>, with additional examples in <a href="/5.6.0/perlop">perlop</a>.</p> </li> <li><p>enhanced debugger and interactive Perl environment, with integrated editor support</p> <p>Described in <a href="/5.6.0/perldebug">perldebug</a>.</p> </li> <li><p>POSIX 1003.1 compliant library</p> <p>Described in <a href="/5.6.0/POSIX">POSIX</a>.</p> </li> </ul> <p>Okay, that&#39;s <i>definitely</i> enough hype.</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