CINXE.COM
strictures - Turn on strict and make most warnings fatal - metacpan.org
<!DOCTYPE html> <html lang="en-US"> <head> <title>strictures - Turn on strict and make most warnings fatal - metacpan.org</title> <link rel="preload" as="fetch" href="/account/login_status" crossorigin="anonymous" /> <link href="/assets/style-XFEQ536G.css" rel="stylesheet" type="text/css"> <script src="/assets/main-WXBSEDQJ.js" type="module"></script> <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of strictures - MetaCPAN" href="/dist/strictures/releases.rss" /> <link rel="canonical" href="https://metacpan.org/pod/strictures" /> <meta name="description" content="Turn on strict and make most warnings fatal" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"> <link rel="shortcut icon" href="/static/icons/favicon.ico"> <link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-touch-icon.png"> <link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN"> <script async src="https://perl-ads.perlhacks.com/perl-ads.js"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-E82Q2V8LVD"></script> <meta property="og:site_name" content="MetaCPAN" /> <meta name="twitter:site" content="@metacpan" /> <meta property="og:type" content="article" /> <meta name="twitter:card" content="summary" /> <meta property="og:url" content="https://metacpan.org/pod/strictures" /> <meta property="og:title" content="strictures" /> <meta property="og:description" content="Turn on strict and make most warnings fatal" /> <meta property="og:image" content="https://metacpan.org/static/images/dots.png" /> </head> <body> <nav class="navbar navbar-default" role="navigation"> <div class="header-logo-large hidden-xs"> <a href="/" tabindex="0"> <svg class="logo" aria-label="MetaCPAN"> <use class="logo" href="/static/images/metacpan-logo.svg#logo" /> </svg> </a> </div> <div class="header-logo-icon visible-xs"> <a href="/"> <svg class="logo" aria-label="MetaCPAN"> <use class="logo" href="/static/images/metacpan-logo.svg#dots" /> </svg> </a> </div> <ul class="nav navbar-nav menu-items hidden-xs hidden-sm"> <li><a href="/about">About</a></li> <li><a href="/about/sponsors">Sponsor</a></li> <li><a href="https://grep.metacpan.org/">grep::cpan</a></li> <li><a href="/recent">Recent</a></li> <li><a href="/about/faq">FAQ</a></li> <li><a href="/tools">Tools</a></li> <li><a href="https://fastapi.metacpan.org/">API</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <button type="button" class="searchbar-btn visible-xs visible-sm"> <i class="fa fa-search button-fa-icon"></i> </button> <form action="/search" class="searchbar-form visible-md visible-lg search-form form-horizontal"> <input type="hidden" name="size" id="metacpan_search-size" value="20"> <div class="form-group"> <div class="search-group"> <i class="fa fa-search"></i> <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value=""> </div> </div> </form> <li class="icon-slidepanel visible-xs visible-sm"> <button data-toggle="slidepanel" data-target=".slidepanel"> <span class="button-fa-icon"> <i class="fa fa-bars slidepanel-open"></i> <i class="fa fa-times slidepanel-close"></i> </span> </button> </li> <li class="dropdown login-dropdown show-logged-in"> <button type="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i> <i class="fas fa-chevron-down"></i> </button> <ul class="dropdown-menu"> <li><a href="/account/identities">Identities</a></li> <li><a href="/account/profile">Profile</a></li> <li><a href="/account/favorite/list">Favorites</a></li> <li> <a href="#" type="button" class="logout-button"> Logout </a> </li> </ul> </li> <li class="dropdown login-dropdown show-logged-out"> <button type="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-user button-fa-icon avatar-placeholder" aria-hidden="true"></i> <i class="fas fa-chevron-down"></i> </button> <ul class="dropdown-menu"> <li> <a href="/login/github"> <i class="fab fa-github fa-fw"></i> GitHub </a> </li> <li> <a href="/login/twitter"> <i class="fab fa-twitter fa-fw"></i> Twitter </a> </li> <li> <a href="/login/google"> <i class="fab fa-google fa-fw"></i> Google </a> </li> </ul> </li> <li class="dropdown login-dropdown hide-logged-in hide-logged-out"> <button> <i class="fa fa-user button-fa-icon" aria-hidden="true"></i> </button> </li> </ul> </nav> <div class="page-content "> <div id="perl-ad-target" class="top-notify-banner perl-ad-target"> </div> <nav class="sidebar"> <div class="slidepanel"> <ul class="nav-list "> <li class="nav-header no-margin-top"> <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of strictures was released."> <span class="relatize">10 Mar 2019 22:08:40 UTC</span> </div> </li> <li> Distribution: <a href="/dist/strictures">strictures</a> </li> <li> Module version: 2.000006 </li> <li> <a data-keyboard-shortcut="g s" href="/dist/strictures/source/lib/strictures.pm">Source</a> (<a href="/dist/strictures/source/lib/strictures.pm?raw=1">raw</a>) </li> <li> <a data-keyboard-shortcut="g b" href="/dist/strictures/source/lib">Browse</a> (<a href="/dist/strictures/source/lib?raw=1">raw</a>) </li> <li> <a data-keyboard-shortcut="g c" href="/dist/strictures/changes">Changes</a> </li> <li> <a class="nopopup" href="/dist/strictures/contribute">How to Contribute</a> </li> <li> <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/p5sagit/strictures">Repository</a> </li> <li> <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=strictures">Issues</a> (1) </li> <li> <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=strictures+2.000006" title="Matrix">Testers</a> <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/s/strictures.html?oncpan=1&distmat=1&version=2.000006&grade=2" style="color: #090">10063</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/s/strictures.html?oncpan=1&distmat=1&version=2.000006&grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/s/strictures.html?oncpan=1&distmat=1&version=2.000006&grade=4">0</a>)</span> </li> <li> <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/HAARG/strictures-2.000006">Kwalitee</a> </li> <li> <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on strictures who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)"> Bus factor: 6 </div> </li> <li> <a rel="noopener nofollow" href="http://cpancover.com/latest/strictures-2.000006/index.html">97.81% Coverage </a> </li> <li> License: perl_5 </li> <li> Perl: v5.6.0 </li> <li class="nav-header">Activity</li> <li> <div class="activity-graph"> <img src="/dist/strictures/activity.svg?res=month" /> <div class="comment">24 month</div> </div> </li> <li class="nav-header">Tools</li> <li> <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/H/HA/HAARG/strictures-2.000006.tar.gz"> Download (<span itemprop="fileSize">21.98KB</span>)</a> </li> <li> <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FHAARG%2Fstrictures-2.000006%2Flib%2Fstrictures.pm"> MetaCPAN Explorer </a> </li> <li> <a href="/dist/strictures/permissions"> Permissions </a> </li> <li> <a href="/dist/strictures/releases.rss"> Subscribe to distribution </a> </li> <li> <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog"> Install Instructions </button> </li> <li> <form action="/search"> <input type="hidden" name="q" value="dist:strictures"> <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form"> <input type="submit" style="display: none"> </form> </li> <li> <form action="https://grep.metacpan.org/search"> <input type="hidden" name="qd" value="strictures"> <input type="hidden" name="source" value="metacpan"> <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form"> <input type="submit" style="display: none"> </form> </li> <li class="version-jump"> <select class="select-navigator form-control tool-bar-form"> <option disabled selected>Jump to version</option> <option disabled value="/release/HAARG/strictures-2.000006/view/lib/strictures.pm" >2.000006 (HAARG on 2019-03-10)</option> <option value="/release/ETHER/strictures-2.000005/view/lib/strictures.pm" >2.000005 (ETHER on 2018-04-20)</option> <option value="/release/HAARG/strictures-2.000004/view/lib/strictures.pm" >2.000004 (HAARG on 2018-04-19)</option> <option value="/release/HAARG/strictures-2.000003/view/lib/strictures.pm" >2.000003 (HAARG on 2016-04-19)</option> <option value="/release/HAARG/strictures-2.000002/view/lib/strictures.pm" >2.000002 (HAARG on 2015-11-04)</option> <option value="/release/HAARG/strictures-2.000001/view/lib/strictures.pm" >2.000001 (HAARG on 2015-06-28)</option> <option value="/release/HAARG/strictures-2.000000/view/lib/strictures.pm" >2.000000 (HAARG on 2015-02-26)</option> <option value="/release/HAARG/strictures-1.999_002/view/lib/strictures.pm" >1.999_002 DEV (HAARG on 2015-02-05)</option> <option value="/release/HAARG/strictures-1.999_001/view/lib/strictures.pm" >1.999_001 DEV (HAARG on 2015-02-01)</option> <option value="/release/HAARG/strictures-1.005006/view/lib/strictures.pm" >1.005006 (HAARG on 2015-01-30)</option> <option value="/release/HAARG/strictures-1.005005/view/lib/strictures.pm" >1.005005 (HAARG on 2014-08-16)</option> <option value="/release/HAARG/strictures-1.005004/view/lib/strictures.pm" >1.005004 (HAARG on 2014-03-06)</option> <option value="/release/HAARG/strictures-1.005003/view/lib/strictures.pm" >1.005003 (HAARG on 2014-02-12)</option> <option value="/release/HAARG/strictures-1.005002/view/lib/strictures.pm" >1.005002 (HAARG on 2013-12-11)</option> <option value="/release/HAARG/strictures-1.005001/view/lib/strictures.pm" >1.005001 (HAARG on 2013-11-07)</option> <option value="/release/HAARG/strictures-1.005000/view/lib/strictures.pm" >1.005000 (HAARG on 2013-11-05)</option> <option value="/release/MSTROUT/strictures-1.004000/view/lib/strictures.pm" >1.004000 (MSTROUT on 2012-07-12)</option> <option value="/release/MSTROUT/strictures-1.003001/view/lib/strictures.pm" >1.003001 (MSTROUT on 2012-04-08)</option> <option value="/release/MSTROUT/strictures-1.003000/view/lib/strictures.pm" >1.003000 (MSTROUT on 2012-04-07)</option> <optgroup label="BackPAN">' <option value="/release/ETHER/strictures-1.004004/view/lib/strictures.pm" >1.004004 (ETHER on 2012-11-12)</option> <option value="/release/ETHER/strictures-1.004003/view/lib/strictures.pm" >1.004003 (ETHER on 2012-11-10)</option> <option value="/release/ETHER/strictures-1.004002/view/lib/strictures.pm" >1.004002 (ETHER on 2012-09-09)</option> <option value="/release/ETHER/strictures-1.004001/view/lib/strictures.pm" >1.004001 (ETHER on 2012-07-12)</option> <option value="/release/MSTROUT/strictures-1.002002/view/lib/strictures.pm" >1.002002 (MSTROUT on 2011-02-25)</option> <option value="/release/MSTROUT/strictures-1.002001/view/lib/strictures.pm" >1.002001 (MSTROUT on 2011-02-25)</option> <option value="/release/MSTROUT/strictures-1.002000/view/lib/strictures.pm" >1.002000 (MSTROUT on 2011-02-16)</option> <option value="/release/MSTROUT/strictures-1.001001/view/lib/strictures.pm" >1.001001 (MSTROUT on 2010-12-05)</option> <option value="/release/MSTROUT/strictures-1.001000/view/lib/strictures.pm" >1.001000 (MSTROUT on 2010-11-22)</option> <option value="/release/MSTROUT/strictures-1.000000/view/lib/strictures.pm" >1.000000 (MSTROUT on 2010-07-18)</option> </optgroup> </select> </li> <li class="version-diff"> <select class="select-navigator form-control tool-bar-form"> <option disabled selected>Diff with version</option> <option disabled value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-2.000006/lib/strictures.pm" >2.000006 (HAARG on 2019-03-10)</option> <option value="/release/HAARG/strictures-2.000006/diff/ETHER/strictures-2.000005/lib/strictures.pm" >2.000005 (ETHER on 2018-04-20)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-2.000004/lib/strictures.pm" >2.000004 (HAARG on 2018-04-19)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-2.000003/lib/strictures.pm" >2.000003 (HAARG on 2016-04-19)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-2.000002/lib/strictures.pm" >2.000002 (HAARG on 2015-11-04)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-2.000001/lib/strictures.pm" >2.000001 (HAARG on 2015-06-28)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-2.000000/lib/strictures.pm" >2.000000 (HAARG on 2015-02-26)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.999_002/lib/strictures.pm" >1.999_002 DEV (HAARG on 2015-02-05)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.999_001/lib/strictures.pm" >1.999_001 DEV (HAARG on 2015-02-01)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005006/lib/strictures.pm" >1.005006 (HAARG on 2015-01-30)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005005/lib/strictures.pm" >1.005005 (HAARG on 2014-08-16)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005004/lib/strictures.pm" >1.005004 (HAARG on 2014-03-06)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005003/lib/strictures.pm" >1.005003 (HAARG on 2014-02-12)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005002/lib/strictures.pm" >1.005002 (HAARG on 2013-12-11)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005001/lib/strictures.pm" >1.005001 (HAARG on 2013-11-07)</option> <option value="/release/HAARG/strictures-2.000006/diff/HAARG/strictures-1.005000/lib/strictures.pm" >1.005000 (HAARG on 2013-11-05)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.004000/lib/strictures.pm" >1.004000 (MSTROUT on 2012-07-12)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.003001/lib/strictures.pm" >1.003001 (MSTROUT on 2012-04-08)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.003000/lib/strictures.pm" >1.003000 (MSTROUT on 2012-04-07)</option> <optgroup label="BackPAN">' <option value="/release/HAARG/strictures-2.000006/diff/ETHER/strictures-1.004004/lib/strictures.pm" >1.004004 (ETHER on 2012-11-12)</option> <option value="/release/HAARG/strictures-2.000006/diff/ETHER/strictures-1.004003/lib/strictures.pm" >1.004003 (ETHER on 2012-11-10)</option> <option value="/release/HAARG/strictures-2.000006/diff/ETHER/strictures-1.004002/lib/strictures.pm" >1.004002 (ETHER on 2012-09-09)</option> <option value="/release/HAARG/strictures-2.000006/diff/ETHER/strictures-1.004001/lib/strictures.pm" >1.004001 (ETHER on 2012-07-12)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.002002/lib/strictures.pm" >1.002002 (MSTROUT on 2011-02-25)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.002001/lib/strictures.pm" >1.002001 (MSTROUT on 2011-02-25)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.002000/lib/strictures.pm" >1.002000 (MSTROUT on 2011-02-16)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.001001/lib/strictures.pm" >1.001001 (MSTROUT on 2010-12-05)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.001000/lib/strictures.pm" >1.001000 (MSTROUT on 2010-11-22)</option> <option value="/release/HAARG/strictures-2.000006/diff/MSTROUT/strictures-1.000000/lib/strictures.pm" >1.000000 (MSTROUT on 2010-07-18)</option> </optgroup> </select> </li> <li> <ul class="dependencies"> <li class="nav-header">Dependencies</li> <li><i class="ttip" title="dynamic_config enabled">unknown</i></li> <li> <hr> </li> <li> <a href="/module/strictures/requires">Reverse dependencies</a> </li> <li> <a href="http://deps.cpantesters.org/?module=strictures">CPAN Testers List</a> </li> <li> <a href="https://cpandeps.grinnz.com/?dist=strictures">Dependency graph</a> </li> </ul> </li> <li class="nav-header">Permalinks</li> <li> <a href="/release/HAARG/strictures-2.000006/view/lib/strictures.pm">This version</a> </li> <li> <a href="/pod/strictures">Latest version</a> </li> <li> <div class="plussers"> <div class="nav-header">++ed by:</div> <div> <a class="display-all" href="/author/IOANR"><img src="https://www.gravatar.com/avatar/98ca06f241752dc58bf366e44e1f1b84?d=identicon&s=20" title="IOANR" alt="IOANR"></a> <a class="display-all" href="/author/JAYALLEN"><img src="https://www.gravatar.com/avatar/34e155145f5145d2e30979313b334327?d=identicon&s=20" title="JAYALLEN" alt="JAYALLEN"></a> <a class="display-all" href="/author/MJGARDNER"><img src="https://www.gravatar.com/avatar/6a6af58937682c4102ae0f02b2b8ff3d?d=identicon&s=20" title="MJGARDNER" alt="MJGARDNER"></a> <a class="display-all" href="/author/RWP"><img src="https://www.gravatar.com/avatar/7110eb2389e69a066d9d7cad7a1cc2bf?d=identicon&s=20" title="RWP" alt="RWP"></a> <a class="display-all" href="/author/MHOWARD"><img src="https://www.gravatar.com/avatar/23ac2fbc91ec185f5da16627eb556667?d=identicon&s=20" title="MHOWARD" alt="MHOWARD"></a> </div> <!-- Display counts of plussers--> <div> <a href="/dist/strictures/plussers">16 PAUSE users</a> </div> <div> 9 non-PAUSE users </div> </div> </li> <li> <div> <button class="contributors-show-button btn-link">and 5 contributors</button> <div id="metacpan_contributors" class="slide-out slide-out-hidden"> <div> <ul> <li class="contributor" data-contrib-email="walde.christian@googlemail.com" > <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&s=20" /> Christian Walde </li> <li class="contributor" data-contrib-email="djerius@cfa.harvard.edu" > <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&s=20" /> Diab Jerius </li> <li class="contributor" data-cpan-author="ETHER" data-contrib-email="ether@cpan.org" > <a href="/author/ETHER" class="cpan-author"> <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/bdc5cd06679e732e262f6c1b450a0237?d=identicon&s=20" /> Karen Etheridge </a> </li> <li class="contributor" data-contrib-email="mst@shadowcat.co.uk" > <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&s=20" /> mst - Matt S. Trout (cpan:MSTROUT) </li> <li class="contributor" data-cpan-author="RIBASUSHI" data-contrib-email="ribasushi@cpan.org" > <a href="/author/RIBASUSHI" class="cpan-author"> <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/6a096fdb29481fa7326735fada56c5cf?d=identicon&s=20" /> Peter Rabbitson </a> </li> </ul> </div> </div> </div> </li> </ul> </div> </nav> <div class="content-navigation"> <div class="breadcrumbs"> <span> <a data-keyboard-shortcut="g a" rel="author" href="/author/HAARG" class="author-name">Graham Knop</a> </span> <span> / </span> <div class="release dist-release status-latest maturity-released"> <span class="dropdown"><b class="caret"></b></span> <select class="select-navigator "> <option selected value="/release/HAARG/strictures-2.000006/view/lib/strictures.pm" >2.000006 (HAARG on 2019-03-10)</option> <option value="/release/ETHER/strictures-2.000005/view/lib/strictures.pm" >2.000005 (ETHER on 2018-04-20)</option> <option value="/release/HAARG/strictures-2.000004/view/lib/strictures.pm" >2.000004 (HAARG on 2018-04-19)</option> <option value="/release/HAARG/strictures-2.000003/view/lib/strictures.pm" >2.000003 (HAARG on 2016-04-19)</option> <option value="/release/HAARG/strictures-2.000002/view/lib/strictures.pm" >2.000002 (HAARG on 2015-11-04)</option> <option value="/release/HAARG/strictures-2.000001/view/lib/strictures.pm" >2.000001 (HAARG on 2015-06-28)</option> <option value="/release/HAARG/strictures-2.000000/view/lib/strictures.pm" >2.000000 (HAARG on 2015-02-26)</option> <option value="/release/HAARG/strictures-1.999_002/view/lib/strictures.pm" >1.999_002 DEV (HAARG on 2015-02-05)</option> <option value="/release/HAARG/strictures-1.999_001/view/lib/strictures.pm" >1.999_001 DEV (HAARG on 2015-02-01)</option> <option value="/release/HAARG/strictures-1.005006/view/lib/strictures.pm" >1.005006 (HAARG on 2015-01-30)</option> <option value="/release/HAARG/strictures-1.005005/view/lib/strictures.pm" >1.005005 (HAARG on 2014-08-16)</option> <option value="/release/HAARG/strictures-1.005004/view/lib/strictures.pm" >1.005004 (HAARG on 2014-03-06)</option> <option value="/release/HAARG/strictures-1.005003/view/lib/strictures.pm" >1.005003 (HAARG on 2014-02-12)</option> <option value="/release/HAARG/strictures-1.005002/view/lib/strictures.pm" >1.005002 (HAARG on 2013-12-11)</option> <option value="/release/HAARG/strictures-1.005001/view/lib/strictures.pm" >1.005001 (HAARG on 2013-11-07)</option> <option value="/release/HAARG/strictures-1.005000/view/lib/strictures.pm" >1.005000 (HAARG on 2013-11-05)</option> <option value="/release/MSTROUT/strictures-1.004000/view/lib/strictures.pm" >1.004000 (MSTROUT on 2012-07-12)</option> <option value="/release/MSTROUT/strictures-1.003001/view/lib/strictures.pm" >1.003001 (MSTROUT on 2012-04-08)</option> <option value="/release/MSTROUT/strictures-1.003000/view/lib/strictures.pm" >1.003000 (MSTROUT on 2012-04-07)</option> <optgroup label="BackPAN">' <option value="/release/ETHER/strictures-1.004004/view/lib/strictures.pm" >1.004004 (ETHER on 2012-11-12)</option> <option value="/release/ETHER/strictures-1.004003/view/lib/strictures.pm" >1.004003 (ETHER on 2012-11-10)</option> <option value="/release/ETHER/strictures-1.004002/view/lib/strictures.pm" >1.004002 (ETHER on 2012-09-09)</option> <option value="/release/ETHER/strictures-1.004001/view/lib/strictures.pm" >1.004001 (ETHER on 2012-07-12)</option> <option value="/release/MSTROUT/strictures-1.002002/view/lib/strictures.pm" >1.002002 (MSTROUT on 2011-02-25)</option> <option value="/release/MSTROUT/strictures-1.002001/view/lib/strictures.pm" >1.002001 (MSTROUT on 2011-02-25)</option> <option value="/release/MSTROUT/strictures-1.002000/view/lib/strictures.pm" >1.002000 (MSTROUT on 2011-02-16)</option> <option value="/release/MSTROUT/strictures-1.001001/view/lib/strictures.pm" >1.001001 (MSTROUT on 2010-12-05)</option> <option value="/release/MSTROUT/strictures-1.001000/view/lib/strictures.pm" >1.001000 (MSTROUT on 2010-11-22)</option> <option value="/release/MSTROUT/strictures-1.000000/view/lib/strictures.pm" >1.000000 (MSTROUT on 2010-07-18)</option> </optgroup> </select> <a data-keyboard-shortcut="g d" class="release-name" href="/dist/strictures">strictures-2.000006</a> </div> <span class="river-gauge-gauge"> <svg width="24px" height="15px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g> <title> River stage three • 239 direct dependents • 999 total dependents </title> <rect x="0" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="5" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="10" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="15" y="0" width="4" height="15" fill="#e4e2e2" /> <rect x="20" y="0" width="4" height="15" fill="#e4e2e2" /> </g> </svg> </span> <div id="strictures-fav" class="show-logged-in"> <form action="/account/favorite/add" style="display: inline" method="POST"> <input type="hidden" name="remove" value="0"> <input type="hidden" name="release" value="strictures-2.000006"> <input type="hidden" name="author" value="HAARG"> <input type="hidden" name="distribution" value="strictures"> <button type="submit" class="favorite highlight"><span>25</span> ++</button> </form> </div> <div class="show-logged-out"> <button class="fav-not-logged-in favorite highlight"><span>25</span> ++</button> </div> / <span>strictures</span> </div> </div> <main class="content"> <nav class="toc"> <div class="toc-header"><strong>Contents</strong></div> <ul> <li><a href="#NAME">NAME</a></li> <li><a href="#SYNOPSIS">SYNOPSIS</a></li> <li><a href="#DESCRIPTION">DESCRIPTION</a></li> <li><a href="#CATEGORY-SELECTIONS">CATEGORY SELECTIONS</a></li> <li><a href="#VERSIONS">VERSIONS</a> <ul> <li><a href="#VERSION-2">VERSION 2</a></li> <li><a href="#VERSION-1">VERSION 1</a></li> </ul> </li> <li><a href="#METHODS">METHODS</a> <ul> <li><a href="#import">import</a></li> <li><a href="#VERSION">VERSION</a></li> </ul> </li> <li><a href="#EXTRA-TESTING-RATIONALE">EXTRA TESTING RATIONALE</a></li> <li><a href="#SEE-ALSO">SEE ALSO</a></li> <li><a href="#COMMUNITY-AND-SUPPORT">COMMUNITY AND SUPPORT</a> <ul> <li><a href="#IRC-channel">IRC channel</a></li> <li><a href="#Git-repository">Git repository</a></li> </ul> </li> <li><a href="#AUTHOR">AUTHOR</a></li> <li><a href="#CONTRIBUTORS">CONTRIBUTORS</a></li> <li><a href="#COPYRIGHT">COPYRIGHT</a></li> <li><a href="#LICENSE">LICENSE</a></li> </ul></nav> <div class="pod anchors"> <h1 id="NAME">NAME</h1> <p>strictures - Turn on strict and make most warnings fatal</p> <h1 id="SYNOPSIS">SYNOPSIS</h1> <pre><code>use strictures 2;</code></pre> <p>is equivalent to</p> <pre><code>use strict; use warnings FATAL => 'all'; use warnings NONFATAL => qw( exec recursion internal malloc newline experimental deprecated portable ); no warnings 'once';</code></pre> <p>except when called from a file which matches:</p> <pre><code>(caller)[1] =~ /^(?:t|xt|lib|blib)[\\\/]/</code></pre> <p>and when either <code>.git</code>, <code>.svn</code>, <code>.hg</code>, or <code>.bzr</code> is present in the current directory (with the intention of only forcing extra tests on the author side) -- or when <code>.git</code>, <code>.svn</code>, <code>.hg</code>, or <code>.bzr</code> is present two directories up along with <code>dist.ini</code> (which would indicate we are in a <code>dzil test</code> operation, via <a href="/pod/Dist::Zilla">Dist::Zilla</a>) -- or when the <code>PERL_STRICTURES_EXTRA</code> environment variable is set, in which case it also does the equivalent of</p> <pre><code>no indirect 'fatal'; no multidimensional; no bareword::filehandles;</code></pre> <p>Note that <code>PERL_STRICTURES_EXTRA</code> may at some point add even more tests, with only a minor version increase, but any changes to the effect of <code>use strictures</code> in normal mode will involve a major version bump.</p> <p>If any of the extra testing modules are not present, <a href="/pod/strictures">strictures</a> will complain loudly, once, via <code>warn()</code>, and then shut up. But you really should consider installing them, they're all great anti-footgun tools.</p> <h1 id="DESCRIPTION">DESCRIPTION</h1> <p>I've been writing the equivalent of this module at the top of my code for about a year now. I figured it was time to make it shorter.</p> <p>Things like the importer in <code>use Moose</code> don't help me because they turn warnings on but don't make them fatal -- which from my point of view is useless because I want an exception to tell me my code isn't warnings-clean.</p> <p>Any time I see a warning from my code, that indicates a mistake.</p> <p>Any time my code encounters a mistake, I want a crash -- not spew to STDERR and then unknown (and probably undesired) subsequent behaviour.</p> <p>I also want to ensure that obvious coding mistakes, like indirect object syntax (and not so obvious mistakes that cause things to accidentally compile as such) get caught, but not at the cost of an XS dependency and not at the cost of blowing things up on another machine.</p> <p>Therefore, <a href="/pod/strictures">strictures</a> turns on additional checking, but only when it thinks it's running in a test file in a VCS checkout -- although if this causes undesired behaviour this can be overridden by setting the <code>PERL_STRICTURES_EXTRA</code> environment variable.</p> <p>If additional useful author side checks come to mind, I'll add them to the <code>PERL_STRICTURES_EXTRA</code> code path only -- this will result in a minor version increase (e.g. 1.000000 to 1.001000 (1.1.0) or similar). Any fixes only to the mechanism of this code will result in a sub-version increase (e.g. 1.000000 to 1.000001 (1.0.1)).</p> <h1 id="CATEGORY-SELECTIONS"><a id="CATEGORY"></a>CATEGORY SELECTIONS</h1> <p>strictures does not enable fatal warnings for all categories.</p> <dl> <dt id="exec">exec</dt> <dd> <p>Includes a warning that can cause your program to continue running unintentionally after an internal fork. Not safe to fatalize.</p> </dd> <dt id="recursion">recursion</dt> <dd> <p>Infinite recursion will end up overflowing the stack eventually anyway.</p> </dd> <dt id="internal">internal</dt> <dd> <p>Triggers deep within perl, in places that are not safe to trap.</p> </dd> <dt id="malloc">malloc</dt> <dd> <p>Triggers deep within perl, in places that are not safe to trap.</p> </dd> <dt id="newline">newline</dt> <dd> <p>Includes a warning for using stat on a valid but suspect filename, ending in a newline.</p> </dd> <dt id="experimental">experimental</dt> <dd> <p>Experimental features are used intentionally.</p> </dd> <dt id="deprecated">deprecated</dt> <dd> <p>Deprecations will inherently be added to in the future in unexpected ways, so making them fatal won't be reliable.</p> </dd> <dt id="portable">portable</dt> <dd> <p>Doesn't indicate an actual problem with the program, only that it may not behave properly if run on a different machine.</p> </dd> <dt id="once">once</dt> <dd> <p>Can't be fatalized. Also triggers very inconsistently, so we just disable it.</p> </dd> </dl> <h1 id="VERSIONS">VERSIONS</h1> <p>Depending on the version of strictures requested, different warnings will be enabled. If no specific version is requested, the current version's behavior will be used. Versions can be requested using perl's standard mechanism:</p> <pre><code>use strictures 2;</code></pre> <p>Or, by passing in a <code>version</code> option:</p> <pre><code>use strictures version => 2;</code></pre> <h2 id="VERSION-2"><a id="VERSION1"></a>VERSION 2</h2> <p>Equivalent to:</p> <pre><code>use strict; use warnings FATAL => 'all'; use warnings NONFATAL => qw( exec recursion internal malloc newline experimental deprecated portable ); no warnings 'once'; # and if in dev mode: no indirect 'fatal'; no multidimensional; no bareword::filehandles;</code></pre> <p>Additionally, any warnings created by modules using <a href="/pod/warnings::register">warnings::register</a> or <code>warnings::register_categories()</code> will not be fatalized.</p> <h2 id="VERSION-1"><a id="VERSION2"></a>VERSION 1</h2> <p>Equivalent to:</p> <pre><code>use strict; use warnings FATAL => 'all'; # and if in dev mode: no indirect 'fatal'; no multidimensional; no bareword::filehandles;</code></pre> <h1 id="METHODS">METHODS</h1> <h2 id="import">import</h2> <p>This method does the setup work described above in <a href="#DESCRIPTION">"DESCRIPTION"</a>. Optionally accepts a <code>version</code> option to request a specific version's behavior.</p> <h2 id="VERSION">VERSION</h2> <p>This method traps the <code>strictures->VERSION(1)</code> call produced by a use line with a version number on it and does the version check.</p> <h1 id="EXTRA-TESTING-RATIONALE"><a id="EXTRA"></a>EXTRA TESTING RATIONALE</h1> <p>Every so often, somebody complains that they're deploying via <code>git pull</code> and that they don't want <a href="/pod/strictures">strictures</a> to enable itself in this case -- and that setting <code>PERL_STRICTURES_EXTRA</code> to 0 isn't acceptable (additional ways to disable extra testing would be welcome but the discussion never seems to get that far).</p> <p>In order to allow us to skip a couple of stages and get straight to a productive conversation, here's my current rationale for turning the extra testing on via a heuristic:</p> <p>The extra testing is all stuff that only ever blows up at compile time; this is intentional. So the oft-raised concern that it's different code being tested is only sort of the case -- none of the modules involved affect the final optree to my knowledge, so the author gets some additional compile time crashes which he/she then fixes, and the rest of the testing is completely valid for all environments.</p> <p>The point of the extra testing -- especially <code>no indirect</code> -- is to catch mistakes that newbie users won't even realise are mistakes without help. For example,</p> <pre><code>foo { ... };</code></pre> <p>where foo is an & prototyped sub that you forgot to import -- this is pernicious to track down since all <i>seems</i> fine until it gets called and you get a crash. Worse still, you can fail to have imported it due to a circular require, at which point you have a load order dependent bug which I've seen before now <i>only</i> show up in production due to tiny differences between the production and the development environment. I wrote <a href="http://shadow.cat/blog/matt-s-trout/indirect-but-still-fatal/">http://shadow.cat/blog/matt-s-trout/indirect-but-still-fatal/</a> to explain this particular problem before <a href="/pod/strictures">strictures</a> itself existed.</p> <p>As such, in my experience so far <a href="/pod/strictures">strictures</a>' extra testing has <i>avoided</i> production versus development differences, not caused them.</p> <p>Additionally, <a href="/pod/strictures">strictures</a>' policy is very much "try and provide as much protection as possible for newbies -- who won't think about whether there's an option to turn on or not" -- so having only the environment variable is not sufficient to achieve that (I get to explain that you need to add <code>use strict</code> at least once a week on freenode #perl -- newbies sometimes completely skip steps because they don't understand that that step is important).</p> <p>I make no claims that the heuristic is perfect -- it's already been evolved significantly over time, especially for 1.004 where we changed things to ensure it only fires on files in your checkout (rather than <a href="/pod/strictures">strictures</a>-using modules you happened to have installed, which was just silly). However, I hope the above clarifies why a heuristic approach is not only necessary but desirable from a point of view of providing new users with as much safety as possible, and will allow any future discussion on the subject to focus on "how do we minimise annoyance to people deploying from checkouts intentionally".</p> <h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1> <ul> <li><p><a href="/pod/indirect">indirect</a></p> </li> <li><p><a href="/pod/multidimensional">multidimensional</a></p> </li> <li><p><a href="/pod/bareword::filehandles">bareword::filehandles</a></p> </li> </ul> <h1 id="COMMUNITY-AND-SUPPORT"><a id="COMMUNITY"></a>COMMUNITY AND SUPPORT</h1> <h2 id="IRC-channel"><a id="IRC"></a>IRC channel</h2> <p>irc.perl.org #toolchain</p> <p>(or bug 'mst' in query on there or freenode)</p> <h2 id="Git-repository"><a id="Git"></a>Git repository</h2> <p>Gitweb is on http://git.shadowcat.co.uk/ and the clone URL is:</p> <pre><code>git clone git://git.shadowcat.co.uk/p5sagit/strictures.git</code></pre> <p>The web interface to the repository is at:</p> <pre><code>http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git</code></pre> <h1 id="AUTHOR">AUTHOR</h1> <p>mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk></p> <h1 id="CONTRIBUTORS">CONTRIBUTORS</h1> <p>Karen Etheridge (cpan:ETHER) <ether@cpan.org></p> <p>Mithaldu - Christian Walde (cpan:MITHALDU) <walde.christian@gmail.com></p> <p>haarg - Graham Knop (cpan:HAARG) <haarg@haarg.org></p> <h1 id="COPYRIGHT">COPYRIGHT</h1> <p>Copyright (c) 2010 the strictures <a href="#AUTHOR">"AUTHOR"</a> and <a href="#CONTRIBUTORS">"CONTRIBUTORS"</a> as listed above.</p> <h1 id="LICENSE">LICENSE</h1> <p>This library is free software and may be distributed under the same terms as perl itself.</p></div> <div id="metacpan_install-instructions-dialog" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Module Install Instructions</h4> </div> <div class="modal-body"> <p>To install strictures, copy and paste the appropriate command in to your terminal.</p> <p><a href="/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p> <pre><code>cpanm strictures</code></pre> <p><a href="/pod/CPAN">CPAN shell</a></p> <pre><code>perl -MCPAN -e shell install strictures</code></pre> <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p> </div> <div class="modal-footer"> <a href="#" data-dismiss="modal" class="btn">Close</a> </div> </div> </div> </div> </main> <div class="content-pagination"> </div> </div> <footer class="footer"> <div class="footer-container"> <div class="footer-social"> <div class="footer-link footer-logo"> <a href="/"> <img src="/static/images/metacpan-logo.svg" alt="MetaCPAN" /> </a> </div> <a class="footer-social-link" href="https://github.com/metacpan"> <i class="fab fa-github-square"></i> </a> <a class="footer-social-link" href="https://fosstodon.org/@metacpan"> <i class="fab fa-mastodon"></i> </a> </div> <div class="footer-links"> <div class="footer-link"> <a href="/about">About</a> </div> <div class="footer-link"> <a href="/about/sponsors">Sponsor</a> </div> <div class="footer-link"> <a href="https://grep.metacpan.org">grep::cpan</a> </div> <div class="footer-link"> <a href="/recent">Recent</a> </div> <div class="footer-link"> <a href="/about/faq">FAQ</a> </div> <div class="footer-link"> <a href="/tools">Tools</a> </div> <div class="footer-link"> <a href="https://fastapi.metacpan.org/">API</a> </div> <div class="footer-link"> <a href="https://www.perl.org/">Perl.org</a> </div> </div> <div class="footer-sponsors"> <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener"> <img class="footer-sponsor-bytemark" src="/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener"> <img class="footer-sponsor-liquidweb" src="/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener"> <img class="footer-sponsor-deriv" src="/static/images/sponsors/deriv.svg" alt="Deriv logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener"> <img class="footer-sponsor-geocode" src="/static/images/sponsors/geocodelogo.svg" alt="Geocode logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener"> <img class="footer-sponsor-fastly" src="/static/images/sponsors/fastly_logo.svg" alt="Fastly logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener"> <img class="footer-sponsor-opencage" src="/static/images/sponsors/open-cage.svg" alt="OpenCage logo"> </a> <!-- Added 2024-07-22 --> <a class="footer-sponsor-link" target="_blank" href="https://www.elastic.co/" rel="noopener"> <img class="footer-sponsor-elastic" src="/static/images/sponsors/elastic.svg" alt="Elastic logo"> </a> <!-- Added 2024-07-22 --> <a class="footer-sponsor-link" target="_blank" href="https://route4me.com/" rel="noopener"> <img class="footer-sponsor-route4me" src="/static/images/sponsors/route4me.png" alt="Route4Me logo"> </a> </div> </div> </footer> <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Keyboard Shortcuts</h4> </div> <div class="modal-body row"> <div class="col-md-6"> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>Global</th> </tr> </thead> <tbody> <tr> <td class="keys"> <kbd>s</kbd> </td> <td>Focus search bar</td> </tr> <tr> <td class="keys"> <kbd>?</kbd> </td> <td>Bring up this help dialog</td> </tr> </tbody> </table> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>GitHub</th> </tr> </thead> <tbody> <tr> <td class="keys"> <kbd>g</kbd> <kbd>p</kbd> </td> <td>Go to pull requests</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>i</kbd> </td> <td>go to github issues (only if github is preferred repository)</td> </tr> </tbody> </table> </div> <div class="col-md-6"> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>POD</th> </tr> </thead> <tbody> <tr> <td class="keys"> <kbd>g</kbd> <kbd>a</kbd> </td> <td>Go to author</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>c</kbd> </td> <td>Go to changes</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>i</kbd> </td> <td>Go to issues</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>d</kbd> </td> <td>Go to dist</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>r</kbd> </td> <td>Go to repository/SCM</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>s</kbd> </td> <td>Go to source</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>b</kbd> </td> <td>Go to file browse</td> </tr> </tbody> </table> </div> <div class="col-md-12"> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>Search terms</th> </tr> </thead> <tbody> <tr> <td><em>module:</em> (e.g. <a href="/search?q=module%3APlugin">module:Plugin</a>)</td> </tr> <tr> <td><em>distribution:</em> (e.g. <a href="/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td> </tr> <tr> <td><em>author:</em> (e.g. <a href="/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td> </tr> <tr> <td><em>version:</em> (e.g. <a href="/search?q=version%3A1.00">version:1.00</a>)</td> </tr> </tbody> </table> </div> </div> <div class="modal-footer"></div> </div> </div> </div> </body> </html>