CINXE.COM

Profiling in Perl | Dr Dobb's

<!DOCTYPE html><html> <head> <!-- default/layout/scripts/article --> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=EDGE"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />--> <script type="text/javascript" src="https://twimgs.com/ddj/detect.js"></script> <link rel="stylesheet" type="text/css" href="https://twimgs.com/infoweek/iwk_refresh/css/poll.css" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <title>Profiling in Perl | Dr Dobb's</title><meta name="description" content="Recursive subroutines are essential for many tasks. But they can slow your app to a crawl if handled incorrectly. Perl's profiler can help pinpoint the bottlenecks." /> <meta name="headline" content="Profiling in Perl" /> <meta name="news_keywords" content="software development, source code, Architecture &amp; Design, Eclipse &amp; Open Source, Windows/.NET, Database, Testing &amp; Debugging, SOA, Web Services &amp; XML, Mobility" /> <meta name="created" content="April 09, 2001" /> <meta name="google-site-verification" content="HqG7-1r7RoBTg-CKrClDy746Njj0o8y-9CgeYSK4CyM" /> <meta name="original-source" content="http://drdobbs.com/profiling-in-perl/184404580" /> <meta property="og:title" content="Profiling in Perl" /> <meta property="og:type" content="article" /> <meta property="og:url" content="http://drdobbs.com/profiling-in-perl/184404580" /> <meta property="og:image" content="http://i.cmpnet.com/ddj/digital/ddj.gif" /> <meta property="og:site_name" content="Dr. Dobb's" /> <meta property="og:description" content="Recursive subroutines are essential for many tasks. But they can slow your app to a crawl if handled incorrectly. Perl's profiler can help pinpoint the bottlenecks." /> <meta property="fb:admins" content="550301723,1033888255" /> <meta property="fb:page_id" content="17631669579" /> <meta property="twitter:card" content="summary" /> <meta property="twitter:site" content="@dr_dobbs" /> <meta property="twitter:title" content="Profiling in Perl" /> <meta property="twitter:description" content="Recursive subroutines are essential for many tasks. But they can slow your app to a crawl if handled incorrectly. Perl's profiler can help pinpoint the bottlenecks." /> <meta property="twitter:creator" content="@dr_dobbs" /> <meta property="twitter:url" content="http://drdobbs.com/profiling-in-perl/184404580" /> <meta property="twitter:image:src" content="http://i.cmpnet.com/ddj/digital/ddj.gif" /> <meta property="twitter:domain" content="http://drdobbs.com" /> <link rel="image_src" href="https://twimgs.com/ddj/v2/images/fb_thumbnail.jpg" /> <link rel="stylesheet" href="https://twimgs.com/ddj/v2/css/thickbox.css" /> <link rel="stylesheet" href="https://twimgs.com/ddj/v2/css/style.css" /> <link rel="SHORTCUT ICON" href="https://twimgs.com/ddj/v2/images/favicon.ico"/> <!-- <script language="JavaScript" type="text/javascript" src="https://twimgs.com/nc/mt/js/jquery-1.2.6.min.js"></script>--> <script type="text/javascript" src="https://twimgs.com/custom/library.gtecevent.com/assets/VisitorAPI.js?ormzkk" ></script> <script type="text/javascript" src="https://twimgs.com/custom/library.gtecevent.com/assets/at.js?ormzkk"></script> <script type="text/javascript" src="https://img.drdobbs.com/v2/js/jquery-ui-1.8rc3.custom.min.js"></script> <script language="JavaScript" type="text/javascript" src="https://twimgs.com/nc/mt/js/sidebar.js"></script> <script language="JavaScript" type="text/javascript" src="https://twimgs.com/nc/mt/js/thickbox.js"></script> <script language="JavaScript" type="text/javascript" src="https://twimgs.com/nc/mt/js/togglediv.js"></script> <script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4af4a81901b903fa"></script> <script language="JavaScript" type="text/javascript" src="https://twimgs.com/ddj/v2/scripts/scripts.js"></script> <script language="JavaScript" type="text/javascript" src="https://twimgs.com/ddj/js/popwindow.js"></script> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <link rel="stylesheet" type="text/css" href="https://twimgs.com/ddj/v2/css/h-nav.css" /> <link rel="stylesheet" href="https://twimgs.com/ddj/v2/css/devtest_style.css" /> <style> #container #header #nav { font-size: .9em; margin-top: 0px; margin-left: 5px; width: 999px; position: relative; top: 4px; } /* Absolutely positioned #nav is lower on homepage, see home.css */ @media screen and (max-width : 320px) { #techwebCommentLogin { border-radius: 10px 10px 10px 10px; width: 275px !important; } .subsection.best { float: none !important; } .doublepage .dcol2 { width: auto !important; } } </style> <link href="http://drdobbs.com/profiling-in-perl/184404580" rel="canonical" /> <link href="/rss/all" rel="alternate" type="application/rss+xml" title="Dr. Dobb's All Articles" /> <link href="/rss/all" rel="alternate" type="application/rss+xml" title="Dr. Dobb's All Articles" /> <link href="https://twimgs.com/ddj/v2/css/article/tabs.css" media="screen" rel="stylesheet" type="text/css" /> <link href="https://twimgs.com/ddj/v2/css/devtest_left-col-slim.css" media="screen" rel="stylesheet" type="text/css" /> <link href="https://i.cmpnet.com/informationweek/whitepaper/v3/common/css/twlightbox.css" media="screen" rel="stylesheet" type="text/css" /><script type="text/javascript"> //<![CDATA[ $.ajax({ type: "GET", url: "/checkauth", data: {"referer": encodeURIComponent(document.referrer), "redirectTo": encodeURIComponent(window.location.href)}, success: function(data){ if (data != null) { window.location = data.redirectTo; } }, dataType: "json", async: false, cache: false }); //]]> </script> <script type="text/javascript" src="https://i.cmpnet.com/informationweek/whitepaper/v3/common/js/jquery.url.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/informationweek/whitepaper/v3/common/js/md5_hash.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/informationweek/whitepaper/v3/common/js/twlightbox.js"></script> <script type="text/javascript" src="https://twimgs.com/nojitter/ddj/nextgen.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { $.ajax({ url: "/index/welcome", type: 'POST', data: {"redirectTo": encodeURIComponent(window.location.href) }, success: function(data) { $('.welcome').html(data); $('.welcome').nextGenInit({ width: 780, siteUrlPrefix:'', siteRedirectPrefix: '' }); } }); }); //]]> </script><script type="text/javascript" src="https://twimgs.com/informationweek/js/omniture/custom_tracking.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#nav2 a,.main-menu a,#h-nav_main a,#h-nav a,#tw_superfooter_936 a,.articles.archive a,.subsection.mostpopular a,.articles.no-border a,.article-resources.wrap a,.recent-articles a,.related-resources.first.tabs a,.related-resources.tabs a,.related-resources.first a,.related-resources a,#footergrey a').click (function(event){ itc_tracking($(this),event); }); }); </script><script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-33304291-1']); _gaq.push(['_setDomainName', 'drdobbs.com']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <!-- Start: GPT Sync --> <script> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; googletag.slots = googletag.slots || {}; var gptadslots=[]; </script> <script src="//www.googletagservices.com/tag/js/gpt.js"></script> <script type="text/javascript"> googletag.pubads().setTargeting('kw',['']); googletag.pubads().setTargeting('aid',['184404580']); if (document.documentElement.clientWidth > 767){ gptadslots[1]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[2,2]],'div-gpt-ad-942957474691236830-1') .addService(googletag.pubads()) .setTargeting('pos',['welcome']); } else { gptadslots[30]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[7,7]],'div-gpt-ad-942957474691236830-30') .addService(googletag.pubads()) .setTargeting('pos',['mi']); } if (document.documentElement.clientWidth > 1027){ gptadslots[2]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[1,2]],'div-gpt-ad-942957474691236830-2') .addService(googletag.pubads()) .setTargeting('pos',['wallpaper']); } if (document.documentElement.clientWidth > 767){ gptadslots[3]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[728,90],[970,250]],'div-gpt-ad-942957474691236830-3') .addService(googletag.pubads()) .setTargeting('pos',['top']); } gptadslots[4]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[300,250],[300,600],[336,280],[336,850]],'div-gpt-ad-942957474691236830-4') .addService(googletag.pubads()) .setTargeting('pos',['rec1']); gptadslots[5]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[300,250],[300,600],[336,280],[336,850]],'div-gpt-ad-942957474691236830-5') .addService(googletag.pubads()) .setTargeting('pos',['rec2']); gptadslots[28]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[160,600]],'div-gpt-ad-942957474691236830-28') .addService(googletag.pubads()) .setTargeting('pos',['sky']); gptadslots[24]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[1,1]],'div-gpt-ad-942957474691236830-24') .addService(googletag.pubads()) .setTargeting('pos',['infolink1']); gptadslots[25]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[1,1]],'div-gpt-ad-942957474691236830-25') .addService(googletag.pubads()) .setTargeting('pos',['infolink2']); gptadslots[26]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[1,1]],'div-gpt-ad-942957474691236830-26') .addService(googletag.pubads()) .setTargeting('pos',['infolink3']); gptadslots[27]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[1,1]],'div-gpt-ad-942957474691236830-27') .addService(googletag.pubads()) .setTargeting('pos',['infolink4']); gptadslots[29]=googletag.defineSlot('/3834/drdobbs.home/profiling-in-perl/184404580',[[4,4]],'div-gpt-ad-942957474691236830-29') .addService(googletag.pubads()) .setTargeting('pos',['video']); googletag.pubads().enableSingleRequest(); googletag.pubads().enableAsyncRendering(); googletag.enableServices(); </script> <meta name="pagecaching" content="12"/><meta name="node" content="232"/> <script type="text/javascript" src="https://twimgs.com/ddj/v2/js/article/tabbed-content.jquery.js"></script> <script language='JavaScript' type='text/javascript' src='/common/contentgating.js?version=1.2'></script> <script type='text/javascript'> var _vwo_code=(function(){ var account_id=32069, settings_tolerance=2000, library_tolerance=1500, use_existing_jquery=false, // DO NOT EDIT BELOW THIS LINE f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init(); </script> <link rel="stylesheet" href="https://twimgs.com/informationweek/whitepaper/v3/common/css/mobile.css" /> <!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '832000476880185'); fbq('track', 'PageView'); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=832000476880185&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code --><link rel="stylesheet" type="text/css" href="https://twimgs.com/nojitter/gama/css/informa-iribbon.css" /> <script type="text/javascript" src="https://twimgs.com/nojitter/gama/js/informa-iribbon.js"></script> <script type="text/javascript" src="https://img.deusm.com//darkreading/cookie_banner.js"></script> <link rel="stylesheet" href="https://img.deusm.com//darkreading/cookie_banner_css.css" /></head> <body> <!-- Cookie policy banner --> <script type="text/javascript"> document.gdpr_banner = '<div>' + '<div id = "cookie">' + '<div class="gdpr-popup-border">' + '<div class="gdrp-popup-content">' + '<div id="popup-text">This site uses cookies to provide you with the best user experience possible. By using Dr. Dobb\'s, you accept <a href="https://tech.informa.com/cookie-policy" target="_blank">our use of cookies.</a></div>' + '<div id="popup-buttons"><span class="close-button" >&times;</span></div>' + '</div>' + '</div>' + '</div>' + '</div>' ; </script> <!-- Informa Branding code goes here--> <div id="iribbon-container" style="margin:-8px !important; padding-top:0px !important;"> <button id="iribbon-title" title="show/hide" class="inactive">Informa</button> <div id="iribbon-detail" class="ribbon-hide" style=""> <div id="iribbon-left"> <p>Dr. Dobb's is part of the Informa Tech Division of Informa PLC</p> <ul> <li class="iribbon-mainlink"><a href="https://informa.com/" tabindex="-1" class='iribbon-opacity-out'>Informa PLC</a></li> <li><a href="https://informa.com/About-Us/" tabindex="-1" class='iribbon-opacity-out'>About us</a></li> <li><a href="https://informa.com/Investors/" tabindex="-1" class='iribbon-opacity-out'>Investor relations</a></li> <li><a href="https://informa.com/Talent/" tabindex="-1" class='iribbon-opacity-out'>Talent</a></li> </ul> </div> <div id="iribbon-right"> <p>This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.</p> </div> </div> </div> <br> <!-- Informa Branding code goes here--> <div id='div-gpt-ad-942957474691236830-1'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-1'); }); </script> </div> <div id='div-gpt-ad-942957474691236830-30'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-30'); }); </script> </div> <div id="topAdContainer"> <div id='div-gpt-ad-942957474691236830-2'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-2'); }); </script> </div> </div> <div id="container"> <style> #login, #login a, #login strong { color: white; font-weight: bold; font-size:12px;} </style> <div id="login" class="welcome" style="padding-left: 12px;"> <!-- load dynamically --> </div> <div id="header"> <!-- h-nav --> <header> <div id="h-nav"> <nav> <ul> <li><a href="/subscribe/">Subscribe</a></li> <li><a href="https://www.informationweek.com/profile.asp?update_newsletter=t">Newsletters</a></li> <li><a href="https://www.informationweek.com/whitepaper/topic/developer">Digital Library</a></li> <li><a href="/rss/">RSS</a></li> </ul> </nav> </div> <!-- / h-nav --> <div id="search"> <script language="JavaScript" type="text/javascript"> <!-- $( function() { $('input.search') .click( function() { queryText = $('input#queryText').val(); queryText = queryText.replace(/^\s*/, '').replace(/\s*$/, ''); if (!queryText) { return false; } } ) .attr('disabled', false); } ); //--> </script> <form method="get" action="/sitesearch"> <input type="hidden" name="sort" value="publishDate desc"/> <ul> <li><input type="text" value="" size="40" id="queryText" name="queryText" maxlength="100" class="text"></li> <li><input type="submit" value=" " class="search" disabled="true"></li> </ul> Search: <input type="radio" name="type" value="site" checked /> Site <input type="radio" name="type" value="sourcecode" /> Source Code </form> </div> </br></br> <div id="h-nav_main"> <div id="h-nav_mainSection"> <!-- main section indicator --> <nav> <ul class="navigation"> <li class="h-58"><a name=ddj-header-navbar-home href="/" class="h-58" style="float:left">Home</a></li><li class="h-68"><a name=ddj-header-navbar-articles href="/articles" class="h-68" style="float:left">Articles</a></li><li class="h-58"><a name=ddj-header-navbar-news href="/news" class="h-58" style="float:left">News</a></li><li class="h-58"><a name=ddj-header-navbar-blogs href="/blogs" class="h-58" style="float:left">Blogs</a></li><li class="h-108"><a name=ddj-header-navbar-sourcecode href="/sourcecode" class="h-108" style="float:left">Source Code</a></li><li class="h-148"><a name=ddj-header-navbar-webinars href="http://www.informationweek.com/events/d/d-id/898857" class="h-148" style="float:left">Webinars &amp; Events</a></li> </ul> </nav> </div><div id="clearLeft"></div> <!-- / main section indicator --> <!-- header social icons --> <div id="h-nav_social"> <ul> <li ><a href="https://www.facebook.com/pages/Dr-Dobbs/17631669579" style="float:left"><img src="https://twimgs.com/ddj/v2/images/h-facebook_sm.png" alt="Facebook" border="0" /></a></li> <li ><a href="https://twitter.com/dr_dobbs" style="float:left"><img src="https://twimgs.com/ddj/v2/images/h-twitter_sm.png" alt="Twitter" border="0"></a></li> </ul> </div> <!-- / header social icons --> <!-- go parallel indicator --> <!-- <div id="h-nav_goParallel"> <ul> <li class="h-88"> <a title="Go Parallel" class="gp" href="/go-parallel/" name="ddj-header-navbar-goparallel" style="float:right">Go Parallel</a> </li> </ul> </div> --> <!-- / go parallel indicator --> <div id="h-nav_mainSection-mobile" class="mobile-unit"> <a>Sections<i>&nbsp;&#x25BC;</i></a> <ul class='unstyled'> <li class="h-58"><a name=ddj-header-navbar-home href="/" class="h-58">Home</a></li><li class="h-68"><a name=ddj-header-navbar-articles href="/articles" class="h-68">Articles</a></li><li class="h-58"><a name=ddj-header-navbar-news href="/news" class="h-58">News</a></li><li class="h-58"><a name=ddj-header-navbar-blogs href="/blogs" class="h-58">Blogs</a></li><li class="h-108"><a name=ddj-header-navbar-sourcecode href="/sourcecode" class="h-108">Source Code</a></li><li class="h-148"><a name=ddj-header-navbar-webinars href="http://www.informationweek.com/events/d/d-id/898857" class="h-148">Webinars &amp; Events</a></li> </ul> </div> </div><!-- / h-nav_main --> <script type="application/javascript"> //events listing in universal header $("div#h-nav_mainSection-mobile").hover(function() { $("div#h-nav_mainSection-mobile").children('ul').slideDown(200); }, function() { $("div#h-nav_mainSection-mobile").children('ul').fadeOut(100); }); </script> <script type="text/javascript"> var eventKey = "tw_dev2013"; var eventValue = "01"; document.write('<scr'+'ipt language="javascript1.1" src="https://adserver.adtechus.com/bind?ckey1='+eventKey+';cvalue1='+escape(eventValue.toLowerCase())+'; expiresDays=9125;adct=text/html;misc=123"></scri'+'pt>'); </script> </header> <br> </div> <div id="subnav"> <div id="nav2"> <nav> <ul class="navigation"> <li ><a href="/cloud" style="float:left;" name=ddj-channel-navbar-cloud>Cloud</a></li><li ><a href="/mobile" style="float:left;" name=ddj-channel-navbar-mobile>Mobile</a></li><li ><a href="/parallel" style="float:left;" name=ddj-channel-navbar-parallel>Parallel</a></li><li ><a href="/windows" style="float:left;" name=ddj-channel-navbar-windows>.NET</a></li><li ><a href="/jvm" style="float:left;" name=ddj-channel-navbar-jvm>JVM Languages</a></li><li ><a href="/cpp" style="float:left;" name=ddj-channel-navbar-cpp>C/C++</a></li><li ><a href="/tools" style="float:left;" name=ddj-channel-navbar-tools>Tools</a></li><li ><a href="/architecture-and-design" style="float:left;" name=ddj-channel-navbar-architecture-and-design>Design</a></li><li ><a href="/testing" style="float:left;" name=ddj-channel-navbar-testing>Testing</a></li><li ><a href="/web-development" style="float:left;" name=ddj-channel-navbar-web-development>Web Dev</a></li><li class="lastitem"><a href="/joltawards" style="float:left;" name=ddj-channel-navbar-joltawards>Jolt Awards</a></li> </ul> </nav> </div> <!-- End: nav2 --> </div><!-- End: subnav --> <div id="h-nav2_mainSection-mobile" class="mobile-unit"> <a>Channels<i>&nbsp;&#x25BC;</i></a> <ul class='unstyled'> <li ><a href="/cloud" name=ddj-channel-navbar-cloud>Cloud</a></li><li ><a href="/mobile" name=ddj-channel-navbar-mobile>Mobile</a></li><li ><a href="/parallel" name=ddj-channel-navbar-parallel>Parallel</a></li><li ><a href="/windows" name=ddj-channel-navbar-windows>.NET</a></li><li ><a href="/jvm" name=ddj-channel-navbar-jvm>JVM Languages</a></li><li ><a href="/cpp" name=ddj-channel-navbar-cpp>C/C++</a></li><li ><a href="/tools" name=ddj-channel-navbar-tools>Tools</a></li><li ><a href="/architecture-and-design" name=ddj-channel-navbar-architecture-and-design>Design</a></li><li ><a href="/testing" name=ddj-channel-navbar-testing>Testing</a></li><li ><a href="/web-development" name=ddj-channel-navbar-web-development>Web Dev</a></li><li class="lastitem"><a href="/joltawards" name=ddj-channel-navbar-joltawards>Jolt Awards</a></li> </ul> </div> <script type="application/javascript"> //events listing in universal header $("div#h-nav2_mainSection-mobile").hover(function() { $("div#h-nav2_mainSection-mobile").children('ul').slideDown(200); }, function() { $("div#h-nav2_mainSection-mobile").children('ul').fadeOut(100); }); </script> <div id="leaderboard2"> <div style="margin: 0 auto 0 auto; width: 728px;"> <div id='div-gpt-ad-942957474691236830-3'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-3'); }); </script> </div> </div> </div> <div id="columns"> <div id="content"> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shLegacy.js"></script> <!--<script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shCore.js"></script> --> <script type="text/javascript" src="https://twimgs.com/ddj/v2/syntaxhighlighter/scripts/shCore_new.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushXml.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushVb.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushSql.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushScala.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushSass.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushRuby.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushPython.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushPowerShell.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushPlain.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushPhp.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushPerl.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushJScript.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushJavaFX.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushJava.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushGroovy.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushErlang.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushDiff.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushDelphi.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushCss.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushCSharp.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushCpp.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushColdFusion.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushBash.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushAS3.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shBrushAppleScript.js"></script> <script type="text/javascript" src="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/scripts/shAutoloader.js"></script> <link href="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/styles/shThemeDefault.css" rel="stylesheet" type="text/css" /> <link href="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/styles/shCoreDefault.css" rel="stylesheet" type="text/css" /> <link href="https://i.cmpnet.com/ddj/v2/syntaxhighlighter/styles/shCore.css" rel="stylesheet" type="text/css" /> <script>var ngGatedContentPage = '1';</script> <style> syntaxhighlighter { margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; overflow-x: auto; overflow-y: auto; width: 450px; } </style> <div class="articles no-border"> <span id ="rss" style="float: right; margin-bottom: 3px;"> <a href="/rss"><img alt="RSS" src="https://i.cmpnet.com/ddj/v2/images/rss.gif"></a> </span> <h2></h2> <div class="sharing-tools"> <div class="share-index"> <div style="float: left; margin-right: 40px;" class="share-tweet"> <!-- BEGIN TWEET BUTTON --><a href="https://twitter.com/share" class="twitter-share-button" data-counturl="http://drdobbs.comhttps://www.drdobbs.com/profiling-in-perl/184404580" data-url="http://drdobbs.comhttps://www.drdobbs.com/profiling-in-perl/184404580" data-text="Profiling in Perl" data-via="dr_dobbs" data-related="dr_dobbs" >Tweet</a><script type="text/javascript" charset="utf-8">window.twttr = (function (d,s,id) {var t, js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });}(document, "script", "twitter-wjs")); twttr.ready(function (twttr) { twttr.events.bind('tweet', function(event) { var tweet_id = event.data.tweet_id; var user_id = event.data.user_id; var screen_name = event.data.screen_name; var s=s_gi('cmpglobalvista'); s.evar33=tweet_id; s.evar34='Twitter '+screen_name+' | '+user_id; s.events='event10'; s.tl(this,'o','Twitter Tweet Submitted by User'); }); twttr.events.bind('follow', function(event) { var followed_user_id = event.data.user_id; var followed_screen_name = event.data.screen_name; var s=s_gi('cmpglobalvista'); s.evar34='Twitter '+followed_screen_name+'| '+followed_user_id ; s.events='event11'; s.tl(this,'o','Twitter Account Followed by User'); }); }); </script><!-- END TWEET BUTTON --> </div> <!-- BEGIN FB LIKE --> <div style="float: left; margin-right: 5px;" class="share-facebook-likes"> <script> ( function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); } (document, 'script', 'facebook-jssdk'));</script> <fb:like send="false" action="like" layout="button_count" href="https://www.drdobbs.com/profiling-in-perl/184404580" width="450" show_faces="true"></fb:like> </div> <!-- END FB LIKE --> <!-- Linked In Button --> <div class="share-tweet" style="float: left; margin-right: 6px;"> <script type="text/javascript" src="https://platform.linkedin.com/in.js"></script> <script type="in/share" data-url="https://www.drdobbs.com/profiling-in-perl/184404580"></script> </div> <!-- Linked In Button --> <!-- Google +1 Button --> <div style="float: left; margin-right: 2px;"> <g:plusone size="small" count="false"></g:plusone> </div> <!-- Google +1 Button --> <div class="addthis_toolbox addthis_pill_combo_style" addthis:url="https://www.drdobbs.com/profiling-in-perl/184404580"> <a style="cursor: pointer;" class="addthis_button_stumbleupon at300b" href="https://www.addthis.com/bookmark.php?v=250&amp;winname=addthis&amp;pub=Dr.Dobbs&amp;source=tbx-250&amp;lng=en-US&amp;s=stumbleupon&amp;url=https://www.drdobbs.com/profiling-in-perl/184404580&amp;title=Profiling in Perl&amp;ate=AT-Dr.Dobbs/-/fs-0/4d4fc3809f4d8545/1&amp;sms_ss=1&amp;at_xt=1&amp;CXNID=2000001.5215456080540439074NXC&amp;pre=http%3A%2F%2Fwww.drdobbs.com%2F&amp;tt=0" target="_blank" title="Send to StumbleUpon"> <span class="at300bs at15t_stumbleupon"></span></a> <a class="addthis_button_reddit" style="cursor:pointer"></a> <a title="Send As Email" href="javascript:emailLauncher('/email?articleUrl=','/profiling-in-perl/184404580')" class="addthis_default_style"><img hspace="0" border="0" src="https://i.cmpnet.com/ddj/v2/images/share_email_icon.gif"></a> <a href="/article/print?articleId=184404580&amp;siteSectionName=" class="addthis_default_style"><img hspace="4" border="0" src="https://i.cmpnet.com/ddj/v2/images/share_print_icon.gif"></a> <a href="https://www.drdobbs.com/profiling-in-perl/184404580#" class="addthis_permalink">Permalink</a> <div class="atclear"></div> </div> <script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script> <script src="https://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4af4a81901b903fa" type="text/javascript"></script> <!-- AddThis Button END --> </div> <div style="clear: both;"></div> </div> <script> function emailLauncher(filePath,storyURL) { uri = filePath + encodeURIComponent(storyURL); window.open(uri,"","toolbar=no,scrollbars=auto,location=no,status=no,width=733,height=590,resizable=1"); } </script> <div id="article-header"> <h1 class="story-title">Profiling in Perl</h1> <p class="byline"> By <span class="byline">brian d foy</span>, April 09, 2001</p> <p class="byline-comments"><span> <a href="https://drdobbs.com/profiling-in-perl/184404580#disqus_thread" class="commentLink" data-disqus-identifier="article_184404580"></a> </span></p> <font class="story-teaser">Recursive subroutines are essential for many tasks. But they can slow your app to a crawl if handled incorrectly. Perl's profiler can help pinpoint the bottlenecks.</font><br> </div> <div class="story"> <article> <html> <head> <title>Dr. Dobb's Journal Perl</title> </head> <P> <body> <P> <P> <P> <span class="dek">Recursive subroutines are essential for many tasks. But they can slow your app to a crawl if handled incorrectly. Perl's profiler can help pinpoint the bottlenecks. </span> <P> <P> In the <a href="/documents/s=286/ddj0103bpl/" target="_blank">previous article</a> in this series I introduced you to the Perl debugger and showed you how to write your own. As an example, I created a couple of tools that are typically called profilers because they give information about the program being executed. Now let's use one of the popular profilers available from the <a href="http://search.cpan.org" target="_blank">Comprehensive Perl Archive Network (CPAN)</a>. </p> <P> Profilers allow you to look at the execution of a program from different perspectives. One of the profilers that I created in the last article allowed me to see the number of times a line was executed during the run of the program (a line profiler) so that I could see which statements were being executed the most. The <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> module does that as well as measuring the total execution time of each of the lines. The time that the program spends on a particular bit of code can be more important than the number of times that it is executed (although the two may be related). </p> <P> <P> Consider one of the examples from the previous article. This one line of code may take several seconds or even minutes, because it does a lot behind the scenes to fetch information over a network: </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> #!/usr/bin/perl use LWP::Simple; getstore( 'http://www.perl.org', 'www.perl.org.html' ); __END__ </pre> </td></tr> </table> <P> <P> However, a seemingly more complex line takes no time at all: </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> #!/usr/bin/perl print map { $_ ** 2 } grep { $_ % 2 } sort { $a &#60;=&#62; $b } @ARGV; __END__ </pre> </td></tr> </table> <P> <P> You can easily tell where the program spends its time in these simple examples, but in a large project, you probably will not be able to tell simply by inspection. Indeed, this is why programmers created profilers. </p> <P> You invoke the profiler by specifying which debugger you want to use through the <i><a href="http://www.perldoc.com/perl5.6/pod/perlrun.html" target="_blank">-d</a></i> switch. Remember that perl assumes the module is in the <a href="http://search.cpan.org/search?mode=module&query=Devel" target="_blank">Devel::*</a> namespace. <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> prompt$ perl -d:SmallProf my_script.pl </pre> </td></tr> </table> <P> <P> The <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> module sends its results (the profile) to a special file called smallprof.out in the current working directory. </p> <P> <P> To demonstrate this profiler I created a small program with a recursive subroutine to calculate Fibonacci numbers, which I call <code>fibonacci.pl</code>. Around the year 1202 while travelling the world, <a href="http://www-groups.dcs.st-andrews.ac.uk/~history/Mathematicians/Fibonacci.html" target="_blank">Leonardo Pisano Fibonacci</a> wondered how fast rabbits could breed. If two rabbits bred to produce two more rabbits, and then each of those pairs bred, ad infinitum, how many rabbits are there at a particular point in time? More precisely, Fibonacci asked in his mathematical treatise <a href="http://www-groups.dcs.st-andrews.ac.uk/~history/Mathematicians/Fibonacci.html" target="_blank"><i>Liber abbaci</i></a>: </p> <P> <blockquote> A certain man put a pair of rabbits in a place surrounded on all sides by a wall. How many pairs of rabbits can be produced from that pair in a year if it is supposed that every month each pair begets a new pair which from the second month on becomes productive? </blockquote> <P> <P> To describe this situation, Fibonacci came up with a sequence of numbers such that the next number in the sequence is the sum of the previous two, with the boundary condition that the first two numbers in the sequence are 0 and 1. If I name the function which generates the <i>N</i>th Fibonacci number <i>F(N)</i>, and <i>F(</i>0<i>)</i> is 0 and <i>F(</i>1<i>)</i> is 1 by definition, then <i>F(</i>2<i>)</i> is <i>F(</i> 2 - 1 <i>)</i> + <i>F(</i> 2 - 2<i> )</i> which is <i>F(</i>1<i>) + F(</i>0<i>)</i>, which turns out to be 1. Going on, <i>F(</i>3<i>)</i> is <i>F(</i> 3 - 1 <i>) + F(</i> 3 - 2 <i>)</i>, which is <i>F(</i>2<i>) + F(</i>1<i>)</i> which we expand to <i>F(</i> 2 - 1 <i>) + F(</i> 2 - 2 <i>) + F(</i>1<i>)</i>, which is<i> F(</i>1<i>) + F(</i>0<i>) + F(</i>1<i>)</i> which is 2. As <i>N</i> gets larger, I have to do a lot more work to compute the Fibonacci number, and a lot more work to take care of all of those rabbits. Since I notice the recursive nature of the computation, I can write a recursive subroutine (that calls itself) to do the work. This example not only shows how computationally expensive recursive subroutines can be, but I can highlight another Perl module that is a drop-in fix for that. </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> #!/usr/bin/perl sub fibonacci { my $index = shift; return 0 if $index == 0; return 1 if $index == 1; return fibonacci( $index - 1 ) + fibonacci( $index - 2 ); } print "F($ARGV&#91;0&#93;) is ", fibonacci($ARGV&#91;0&#93;), "\n"; __END__ </pre> </td></tr> </table> <P> <P> My test program takes a single argument (which shows up in the first element of the special <i><a href="http://www.perldoc.com/perl5.6/pod/perlvar.html" target="_blank">@ARGV</a></i> array, <i>$ARGV&#91;0&#93;</i>) &#151; the Fibonacci number to compute. </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> prompt$ perl fibonacci.pl 10 F(10) is 55 </pre> </td></tr> </table> <P> <P> The larger <i>N</i> is, the longer the program takes to complete and the time to finish increases exponentially with <i>N</i>. Try it yourself to see if your computer is faster than mine: </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <P> <h2>Performance of <code>fibonacci()</code></h2> <table cellpadding=15 border=2> <tr> <td>N</td><td>F(N)</td><td>time, seconds</td> </tr> <tr> <td>5</td><td>5</td><td>0</td> </tr> <tr> <td>10</td><td>55</td><td>0</td> </tr> <tr> <td>15</td><td>610</td><td>0.01</td> </tr> <tr> <td>20</td><td>6,765</td><td>0.1</td> </tr> <tr> <td>25</td><td>75,025</td><td>1</td> </tr> <tr> <td>30</td><td>832,040</td><td>12</td> </tr> <tr> <td>35</td><td>9,227,465</td><td>136</td> </tr> <tr> <td>40</td><td>102,334,155</td><td>1607</td> </tr> </table> </td></tr> </table> <P> <P> Why is this program so slow for <i>N</i> above 30? The <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> module gives me a big hint. I already know why it is slow because I made this program to be slow, but in a much larger code base, especially one you inherit, you may not know ahead of time which parts are slow. </p> <P> <P> I run fibonacci.pl using the <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> debugger to determine the Fibonacci number for <i>N</i> = 40 &#151; the number of rabbits I would have after about three years. </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> prompt$ perl -d:SmallProf fibonacci.pl 40 </pre> </td></tr> </table> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> ================ SmallProf version 0.9 ================ Profile of fib.pl Page 1 ================================================================= count wall tm cpu time line 0 0.000000 0.000000 1:#!/usr/bin/perl 0 0.000000 0.000000 2: 0 0.000000 0.000000 3:sub fibonacci 331160281 0.000000 0.000000 4: { 331160281 11031.59 16482.02 5: my $index = shift; 0 0.000000 0.000000 6: 331160281 15974.55 20532.39 7: return 0 if $index == 0; 267914295 15604.80 19898.51 8: return 1 if $index == 1; 0 0.000000 0.000000 9: 165580140 16967.53 18064.83 10: return fibonacci( $index - 1 ) + 0 0.000000 0.000000 11: } 0 0.000000 0.000000 12: 1 0.000116 0.000000 13:print "F($ARGV&#91;0&#93;) is ", fibonacci($ARGV&#91;0&#93;), 0 0.000000 0.000000 14: 0 0.000000 0.000000 15:__END__ </pre> </td></tr> </table> <P> <P> The output has several columns. The first column shows the number of times that line was executed. The next two columns show the total real time (i.e. wall clock time) from <a href="http://search.cpan.org/search?dist=Time-HiRes" target="_blank">Time::HiRes</a> and CPU time (the time actually spent on the computation), from <i>times</i>, for the line. Then the line number is displayed in front the line of code. </p> <P> <P> Simply looking at the first column of smallprof.out I notice that the program executes some lines of code a very large number of times, even though I only directly called the <i>fibonacci()</i> routine once. Every time I want to compute a Fibonacci number, I have to compute other numbers, and the same for each of those. I end up doing the same work over and over again which wastes the computer's time. However, now that I have identified the problem I can fix it. </p> <P> <P> Now I can rework this table to include the number of times the <i>fibonacci()</i> subroutine is called. Ambitious readers can calculate the coefficient for <i>Omega( 1.6<sup>N</sup> )</i>. </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <P> <h2>Performance of <i>fibonacci()</i></h2> <table cellpadding=15 border=2> <tr> <td>N</td><td>F(N)</td><td>Subroutine calls</td><td>time, seconds</td> </tr> <tr> <td>5</td><td>5</td><td>15</td><td>0</td> </tr> <tr> <td>10</td><td>55</td><td>177</td><td>0</td> </tr> <tr> <td>15</td><td>610</td><td>1,973</td><td>0.01</td> </tr> <tr> <td>20</td><td>6,765</td><td>21,891</td><td>0.1</td> </tr> <tr> <td>25</td><td>75,025</td><td>242,785</td><td>1</td> </tr> <tr> <td>30</td><td>832,040</td><td>2,692,537</td><td>12</td> </tr> <tr> <td>35</td><td>9,227,465</td><td>29,860,703</td><td>136</td> </tr> <tr> <td>40</td><td>102,334,155</td><td>331,160,281</td><td>1607</td> </tr> </table> </td></tr> </table> <P> <P> In this case, I can solve the problem by caching the results in between invocations of the subroutine. If I remember what <i>F(N</i>-1<i>)</i> is, I do not have to compute it the next time I need it. I could store these previous results in a globally scoped array, but then I would have to do a bit more coding, and I would have to do similar coding for each routine that I wanted to fix. However, laziness is one of the three virtues of a true programmer. Laziness means creating a general solution that we can use over and over again to make our lives easier. I just described the <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> module. </p> <P> The <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> module is a drop-in solution that caches the results of subroutines so that we do not have to waste time doing work that we have already done. The module, through its magic, <a href="http://hissa.nist.gov/dads/HTML/memoize.html" target="_blank">memoizes</a>, or remembers the result of, a call to a subroutine with a particular argument list. In this case, <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> stores the results of each call to <i>fibonacci()</i> so that we do not have to keep calling the subroutine. </p> <P> I modified my earlier program to use the <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> module. I simply tell <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> which functions need help and let it do the rest. </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> #!/usr/bin/perl use Memoize; memoize('fibonacci'); sub fibonacci { my $index = shift; return 0 if $index == 0; return 1 if $index == 1; return fibonacci( $index - 1 ) + fibonacci( $index - 2 ); } print "F($ARGV&#91;0&#93;) is ", fibonacci($ARGV&#91;0&#93;), "\n"; __END__ </pre> </td></tr> </table> <P> If I run this program for <i>N</i> = 40 I find that it finishes almost instantaneously (at least compared to the last program). If I use the <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> module I can see the change when I run the script again. </p> <P> <table width="100%" border="0"> <tr><td bgcolor="#DDDDDD"> <pre> prompt$ perl -d:SmallProf fibonacci.pl 40 </pre> </td></tr> </table> <P> Since I have run another script under the <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> debugger, the previous results in smallprof.out are overwritten with the new results. Now smallprof.out contains the new profile shown in <a href="/showArticle.jhtml?documentID=ddj0104pl&pgno=2" target="_blank">Example 1</a>. <P> The smallprof.out file, which I have edited to remove several other pages of output dealing with behind-the-scenes magic from <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> and its included modules, shows some extra code pulled in from <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a>, but it takes almost no time to do its magic. However, I notice the same lines in the <code>fibonacci()</code> routine run only 41 times. The same lines for the same input were executed 204,668,309 times in the previous program. The <a href="http://search.cpan.org/search?dist=Memoize" target="_blank">Memoize</a> did its magic and drastically sped up my program. The <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> module is the magic which told me what to fix. </p> <P> <P> Now that you know how to use a profiler to get information about a program, try the <a href="http://search.cpan.org/search?dist=Devel-SmallProf" target="_blank">Devel::SmallProf</a> module or some of the other profilers found on <a href="http://search.cpan.org/search?mode=module&query=Devel" target="_blank">Devel::*</a>. Your code will be running faster in no time, which will give you more time to care for all of those rabbits. </p> <P> <hr> <p class="bio"><i><a href="/cdn-cgi/l/email-protection#54373b39303b331424353a3d2c7a373b39">brian d foy</a></i> has been a Perl user since 1994. He is founder of the first Perl users group, <a href="http://ny.pm.org" target="_blank">NY.pm</a>, and <a href="http://www.perl.org" target="_blank">Perl Mongers</a>, the Perl advocacy organization. He has been teaching Perl through <a href="http://perl.stonehenge.com" target="_blank">Stonehenge Consulting</a> for the past three years, and has been a featured speaker at The Perl Conference, Perl University, YAPC, COMDEX, and Builder.com. Some of brian's other articles have appeared in <i>The Perl Journal</i>. </p> <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script></body> </html> <P> <!-- send Article author Details--> </article> </div> <!-- test --> <br> <div class="nav1"> <center> <br><b>1</b>&nbsp<a href="/profiling-in-perl/184404580?pgno=2" class="contentgating_article">2</a> <a href="/profiling-in-perl/184404580?pgno=2" class="contentgating_article">Next</a> </center> </div> <style type="text/css"> <!-- .nav1 { clear: both; text-align: center; } .topcommenttools .tools { display: table; font-size: .7em; font-weight: bold; padding-bottom: 10px; width: 100%; } .topcommenttools .tools .reply { float: left; } .topcommenttools .tools .share-email-report { float: right; } .topcommenttools .tools .share-email-report span { margin-left: 10px; } .topcommenttools .tools .reply a { background: transparent url('https://i.cmpnet.com/ddj/v2/images/reply.gif') no-repeat 0px 3px; padding-left: 10px; padding-right: 10px; } .topcommenttools .tools .share { background: transparent url('https://i.cmpnet.com/ddj/v2/images/share_icon.gif') no-repeat bottom left; padding-left: 23px; } .topcommenttools .tools .email { background: transparent url('https://i.cmpnet.com/ddj/v2/images/mail_icon.gif') no-repeat bottom left; padding-left: 22px; } .topcommenttools .tools .report { background: transparent url('https://i.cmpnet.com/ddj/v2/images/report_icon.gif') no-repeat bottom left; padding-left: 16px; } --> </style> </div> <!-- Related Reading Box --> <!-- Mobile IMU Script Here --> <script type='text/javascript'> if (document.documentElement.clientWidth <= 767){ document.write('<div id="div-gpt-ad-942957474691236830-4" class="responsive_imu"><center>'); googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-4'); }); document.write('</center></div>'); } </script> <!-- End: Mobile IMU Script Here --> <style> @media only screen and (min-width: 63.75em) { .responsive_imu{ display: none; } } </style> <h3 class="resources">Related Reading</h3> <div class="related-resources first tabs" style="margin-bottom:10px;"> <ul class="toc clearfix"> <li class="first"><a href="#toc-news" title="News">News</a></li> <li><a href="#toc-commentary" title="Commentary">Commentary</a></li> </ul> <div class="tab-content clearfix"> <h3 class="tab"><a name="toc-news">News</a></h3> <!--not from cache.cache key--> <ul class="events"> <li><a class="contentgating_article" href="/jvm/java-plumbr-unlocks-threads/240169442?cid=SBX_ddj_related_news_default_profiling_in_perl&itc=SBX_ddj_related_news_default_profiling_in_perl" title="Java Plumbr Unlocks Threads">Java Plumbr Unlocks Threads</a></li><li><a class="contentgating_article" href="/tools/devart-dbforge-studio-for-mysql-with-phr/240169414?cid=SBX_ddj_related_news_default_profiling_in_perl&itc=SBX_ddj_related_news_default_profiling_in_perl" title="Devart dbForge Studio For MySQL With Phrase Completion">Devart dbForge Studio For MySQL With Phrase Completion</a></li><li><a class="contentgating_article" href="/open-source/mirantis-releases-free-developer-edition/240169410?cid=SBX_ddj_related_news_default_profiling_in_perl&itc=SBX_ddj_related_news_default_profiling_in_perl" title="Mirantis Releases Free Developer Edition">Mirantis Releases Free Developer Edition</a></li><li><a class="contentgating_article" href="/web-development/mac-os-installer-platform-from-installco/240169369?cid=SBX_ddj_related_news_default_profiling_in_perl&itc=SBX_ddj_related_news_default_profiling_in_perl" title="Mac OS Installer Platform From installCore">Mac OS Installer Platform From installCore</a></li><a class="continue" href="/news?cid=SBX_ddj_related_news_default_profiling_in_perl&itc=SBX_ddj_related_news_default_profiling_in_perl" title="More News">More News<span>&raquo;</span></a> </ul> </div> <div class="tab-content clearfix"> <h3 class="tab"><a name="toc-commentary">Commentary</a></h3> <!--not from cache.cache key--> <ul class="events"> <li><a class="contentgating_article" href="/embedded-systems/things-that-go-boom/240169445?cid=SBX_ddj_related_commentary_default_profiling_in_perl&itc=SBX_ddj_related_commentary_default_profiling_in_perl" title="Things That Go Boom">Things That Go Boom</a></li><li><a class="contentgating_article" href="/joltawards/jolt-awards-2015-coding-tools/240169420?cid=SBX_ddj_related_commentary_default_profiling_in_perl&itc=SBX_ddj_related_commentary_default_profiling_in_perl" title="Jolt Awards 2015: Coding Tools">Jolt Awards 2015: Coding Tools</a></li><li><a class="contentgating_article" href="/joltawards/jolt-awards-2015-coding-tools/240169420?cid=SBX_ddj_related_commentary_default_profiling_in_perl&itc=SBX_ddj_related_commentary_default_profiling_in_perl" title="Jolt Awards 2015: Coding Tools">Jolt Awards 2015: Coding Tools</a></li><li><a class="contentgating_article" href="/cpp/abstractions-for-binary-search-part-9-wh/240169416?cid=SBX_ddj_related_commentary_default_profiling_in_perl&itc=SBX_ddj_related_commentary_default_profiling_in_perl" title="Abstractions For Binary Search, Part 9: What Do We Need to Test?">Abstractions For Binary Search, Part 9: What Do We Need to Test?</a></li><a class="continue" href="/articles?cid=SBX_ddj_related_commentary_default_profiling_in_perl&itc=SBX_ddj_related_commentary_default_profiling_in_perl" title="More Commentary">More Commentary<span>&raquo;</span></a> </ul> </div> </div> <div class="related-resources tabs" style="margin-bottom:10px;"> <ul class="toc clearfix"> <li class="first"><a href="#toc-slideshow" title="Slideshow">Slideshow</a></li> <li><a href="#toc-video" title="Video">Video</a></li> </ul> <div class="tab-content clearfix"> <h3 class="tab"><a name="toc-slideshow">Slideshow</a></h3> <!--not from cache.cache key--> <ul class="events"> <li><a class="contentgating_article" href="/joltawards/jolt-awards-2015-coding-tools/240169420?cid=SBX_ddj_related_slideshow_default_profiling_in_perl&itc=SBX_ddj_related_slideshow_default_profiling_in_perl" title="Jolt Awards 2015: Coding Tools">Jolt Awards 2015: Coding Tools</a></li><li><a class="contentgating_article" href="/tools/jolt-awards-2014-the-best-utilities/240168811?cid=SBX_ddj_related_slideshow_default_profiling_in_perl&itc=SBX_ddj_related_slideshow_default_profiling_in_perl" title="Jolt Awards 2014: The Best Utilities">Jolt Awards 2014: The Best Utilities</a></li><li><a class="contentgating_article" href="/architecture-and-design/2013-developer-salary-survey/240163580?cid=SBX_ddj_related_slideshow_default_profiling_in_perl&itc=SBX_ddj_related_slideshow_default_profiling_in_perl" title="2013 Developer Salary Survey">2013 Developer Salary Survey</a></li><li><a class="contentgating_article" href="/joltawards/jolt-awards-coding-tools/240147989?cid=SBX_ddj_related_slideshow_default_profiling_in_perl&itc=SBX_ddj_related_slideshow_default_profiling_in_perl" title="Jolt Awards: Coding Tools">Jolt Awards: Coding Tools</a></li><a class="continue" href="/slideshows?cid=SBX_ddj_related_slideshow_default_profiling_in_perl&itc=SBX_ddj_related_slideshow_default_profiling_in_perl" title="More Slideshows">More Slideshows<span>&raquo;</span></a> </ul> </div> <div class="tab-content clearfix"> <h3 class="tab"><a name="toc-video">Video</a></h3> <!--not from cache.cache key--> <ul class="events"> <li><a class="contentgating_article" href="/architecture-and-design/ibm-five-in-five-predictions/240164949?cid=SBX_ddj_related_video_default_profiling_in_perl&itc=SBX_ddj_related_video_default_profiling_in_perl" title="IBM Five in Five Predictions">IBM Five in Five Predictions</a></li><li><a class="contentgating_article" href="/cloud/ibm-watson-developers-cloud/240164016?cid=SBX_ddj_related_video_default_profiling_in_perl&itc=SBX_ddj_related_video_default_profiling_in_perl" title="IBM Watson Developers Cloud">IBM Watson Developers Cloud</a></li><li><a class="contentgating_article" href="/architecture-and-design/solve-for-tomorrow/240153856?cid=SBX_ddj_related_video_default_profiling_in_perl&itc=SBX_ddj_related_video_default_profiling_in_perl" title="Solve for Tomorrow">Solve for Tomorrow</a></li><li><a class="contentgating_article" href="/architecture-and-design/connected-vehicles/240148293?cid=SBX_ddj_related_video_default_profiling_in_perl&itc=SBX_ddj_related_video_default_profiling_in_perl" title="Connected Vehicles">Connected Vehicles</a></li><a class="continue" href="/video/archives?cid=SBX_ddj_related_video_default_profiling_in_perl&itc=SBX_ddj_related_video_default_profiling_in_perl" title="More Videos">More Videos<span>&raquo;</span></a> </ul> </div> </div> <div class="related-resources tabs" style="margin-bottom:10px;"> <ul class="toc clearfix"> <li class="first"><a href="#toc-most-popular" title="Most Popular">Most Popular</a></li> </ul> <div class="tab-content clearfix"> <h3 class="tab"><a name="toc-most-popular">Most Popular</a></h3> <!--not from cache.cache key--> <ul class="events"> <li><a class="contentgating_article" href="/web-development/restful-web-services-a-tutorial/240169069?cid=SBX_ddj_related_mostpopular_default_profiling_in_perl&itc=SBX_ddj_related_mostpopular_default_profiling_in_perl" title="RESTful Web Services: A Tutorial">RESTful Web Services: A Tutorial</a></li><li><a class="contentgating_article" href="/jvm/lambda-expressions-in-java-8/240166764?cid=SBX_ddj_related_mostpopular_default_profiling_in_perl&itc=SBX_ddj_related_mostpopular_default_profiling_in_perl" title="Lambda Expressions in Java 8">Lambda Expressions in Java 8</a></li><li><a class="contentgating_article" href="/jvm/an-algorithm-for-compressing-space-and-t/184406478?cid=SBX_ddj_related_mostpopular_default_profiling_in_perl&itc=SBX_ddj_related_mostpopular_default_profiling_in_perl" title="An Algorithm for Compressing Space and Time">An Algorithm for Compressing Space and Time</a></li><li><a class="contentgating_article" href="/jvm/why-build-your-java-projects-with-gradle/240168608?cid=SBX_ddj_related_mostpopular_default_profiling_in_perl&itc=SBX_ddj_related_mostpopular_default_profiling_in_perl" title="Why Build Your Java Projects with Gradle Rather than Ant or Maven?">Why Build Your Java Projects with Gradle Rather than Ant or Maven?</a></li><a class="continue" href="/?cid=SBX_ddj_related_mostpopular_default_profiling_in_perl&itc=SBX_ddj_related_mostpopular_default_profiling_in_perl" title="More Popular">More Popular<span>&raquo;</span></a> </ul> </div> </div> <hr style="margin-bottom:10px;"/> <h3 class="resources">More Insights</h3> <div class="related-resources first" style="margin-bottom:10px;"> <!-- Taxonomy ID: --><!--not from cache.cache key--><h3>White Papers</h3> <!-- Taxonomy ID: --> <ul class="archive"> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/security/2022-insurance-industry-cyber-threat-landscape-report/436573?cid=SBX_ddj_well_wp_default_profiling_in_perl&itc=SBX_ddj_well_wp_default_profiling_in_perl"> 2022 Insurance Industry Cyber Threat Landscape Report </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/security/2021-banking-and-financial-services-industry-cyber-threat-landscape-report/436543?cid=SBX_ddj_well_wp_default_profiling_in_perl&itc=SBX_ddj_well_wp_default_profiling_in_perl"> 2021 Banking and Financial Services Industry Cyber Threat Landscape Report </a> </li> </ul> <a title='More White Papers' href='/whitepaper/all/more.html?cid=SBX_ddj_well_wp_default_profiling_in_perl&itc=SBX_ddj_well_wp_default_profiling_in_perl' class='continue'>More <span>>></span></a> </div> <div class="related-resources" style="margin-bottom:10px;"> <!-- Taxonomy ID: --><!--not from cache.cache key--><h3>Reports</h3> <!-- Taxonomy ID: --> <ul class="archive"> <li><!--Rule 10 --> <a target="_new" href="https://techlibrary.tradepub.com/c/pubRD.mpl?secure=1&sr=pp&_t=pp:&pc=w_tean83&ch=SBX&cid=SBX_ddj_well_Analytics_default_profiling_in_perl&itc=SBX_ddj_well_Analytics_default_profiling_in_perl"> State of ITSM in Manufacturing </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://informationweek.com/whitepaper/cybersecurity/database-security/2021-data-breach-investigations-report-%28dbir%29/430043?gset=yes&&cid=SBX_ddj_well_Analytics_default_profiling_in_perl&itc=SBX_ddj_well_Analytics_default_profiling_in_perl"> 2021 Data Breach Investigations Report (DBIR) </a> </li> </ul> <a title='More Reports' href='/analytics/all/more.html?cid=SBX_ddj_well_Analytics_default_profiling_in_perl&itc=SBX_ddj_well_Analytics_default_profiling_in_perl' class='continue'>More <span>>></span></a> </div> <div class="related-resources" style="margin-bottom:10px;"> <!-- Taxonomy ID: --><!--not from cache.cache key--><h3>Webcasts</h3> <!-- Taxonomy ID: --> <ul class="archive"> <li><!--Rule 10 --> <a target="_new" href="https://webinar.darkreading.com/1296129?keycode=sbx&cid=SBX_ddj_well_Webcast_default_profiling_in_perl&itc=SBX_ddj_well_Webcast_default_profiling_in_perl&K=SBX_DDJ_WL"> Making Deception a Part of Your Enterprise Defense Strategy </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://event.on24.com/wcc/r/3656589/D5BEC18F1C422962B1243FCED88437E1?partnerref=darkreading&cid=SBX_ddj_well_Webcast_default_profiling_in_perl&itc=SBX_ddj_well_Webcast_default_profiling_in_perl&K=SBX_DDJ_WL"> A Black Hat Webinar: Inside the Cyber Safety Review Board: A Fireside Chat with Jeff Moss, Chair Rob Silvers and Deputy Chair Heather Adkins </a> </li> </ul> <a title='More Webcast' href='/webcast/all/more.html?cid=SBX_ddj_well_Webcast_default_profiling_in_perl&itc=SBX_ddj_well_Webcast_default_profiling_in_perl' class='continue'>More <span>>></span></a> </div> <hr /><!-- / Related Reading Box --> <div class="dcolmask doublepage"> <div class="dcolleft"> <div class="dcol1"> <!-- Column 1 start --> <div id="left-col" style="width:160px;"> <div class="infolink"> <span style="font-size: 0.7em; font-weight: bold;">INFO-LINK</span> <ul style="color: rgb(33, 82, 190); font-size: 0.7em; list-style: none outside none; margin-top: 0px; padding: 8px 0px 0px;"> <li style="padding-left: 15px; background: url(&quot;https://i.cmpnet.com/nc/mt/bg_left-nav.png&quot;) no-repeat scroll 5px 7px transparent; color: rgb(0, 59, 176); margin: 0px 0pt;"> <div id='div-gpt-ad-942957474691236830-24'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-24'); }); </script> </div> </li> <li style="padding-left: 15px; background: url(&quot;https://i.cmpnet.com/nc/mt/bg_left-nav.png&quot;) no-repeat scroll 5px 7px transparent; color: rgb(0, 59, 176); margin: 0px 0pt;"> <div id='div-gpt-ad-942957474691236830-25'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-25'); }); </script> </div> </li> <li style="padding-left: 15px; background: url(&quot;https://i.cmpnet.com/nc/mt/bg_left-nav.png&quot;) no-repeat scroll 5px 7px transparent; color: rgb(0, 59, 176); margin: 0px 0pt;"> <div id='div-gpt-ad-942957474691236830-26'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-26'); }); </script> </div> </li> <li style="padding-left: 15px; background: url(&quot;https://i.cmpnet.com/nc/mt/bg_left-nav.png&quot;) no-repeat scroll 5px 7px transparent; color: rgb(0, 59, 176); margin: 0px 0pt;"> <div id='div-gpt-ad-942957474691236830-27'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-27'); }); </script> </div> </li> </ul> </div> <br/> <br/> <div id='div-gpt-ad-942957474691236830-28'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-28'); }); </script> </div> </div> </div> <div class="dcol2" style="left:71%;width:70%;float:left;"> <!-- Commenting --> <div id="dobbs_disqus"> <div id="disqus-hints-box"> <script type="text/javascript" src="https://twimgs.com/brainyard/js/colorbox/jquery.colorbox-min.js"></script> <script type="text/javascript"> var brainyardDomain = 'drdobbs.com'; </script> <script type="text/javascript" src="https://twimgs.com/brainyard/js/disqusHints.js"></script> <!-- This section is for calling the commenting policy pop-up --> <script> $(document).ready(function(){ $(".commentingPolicy").colorbox({width:"420px",height:"300px",inline:true,href:"#inlineCommenting"});//end .htmlTags });//end doc ready </script> <link rel="stylesheet" href="https://twimgs.com/brainyard/css/colorbox.css" type="text/css" /> <link rel="stylesheet" href="https://twimgs.com/brainyard/css/disqusHints.css" type="text/css" /> <div style='display:none'> <div id='inlineModal' style='padding:10px;'> <div class="newsletterHeader"> <img src="https://twimgs.com/ddj/images/dobbs_disqus_logo.gif" /> </div> <br /><br /> <div class="markdown"> <h3>Currently we allow the following HTML tags in comments:</h3> <h3>Single tags</h3> <p><i>These tags can be used alone and don't need an ending tag. </i></p> <p><code>&lt;br&gt;</code> Defines a single line break <br /><br /> <code>&lt;hr&gt;</code> Defines a horizontal line</p> <h3>Matching tags</h3> <p><i>These require an ending tag - e.g. <code>&lt;i&gt;italic text&lt;/i&gt;</code> </i></p> <p><code>&lt;a&gt;</code> Defines an anchor<br /><br /> <code>&lt;b&gt;</code> Defines bold text<br /><br /> <code>&lt;big&gt;</code> Defines big text<br /><br /> <code>&lt;blockquote&gt;</code> Defines a long quotation<br /><br /> <code>&lt;caption&gt;</code> Defines a table caption<br /><br /> <code>&lt;cite&gt;</code> Defines a citation<br /><br /> <code>&lt;code&gt;</code> Defines computer code text<br /><br /> <code>&lt;em&gt;</code> Defines emphasized text<br /><br /> <code>&lt;fieldset&gt;</code> Defines a border around elements in a form<br /><br /> <code>&lt;h1&gt;</code> This is heading 1<br /><br /> <code>&lt;h2&gt;</code> This is heading 2<br /><br /> <code>&lt;h3&gt;</code> This is heading 3<br /><br /> <code>&lt;h4&gt;</code> This is heading 4<br /><br /> <code>&lt;h5&gt;</code> This is heading 5<br /><br /> <code>&lt;h6&gt;</code> This is heading 6<br /><br /> <code>&lt;i&gt;</code> Defines italic text<br /><br /> <code>&lt;p&gt;</code> Defines a paragraph<br /><br /> <code>&lt;pre&gt;</code> Defines preformatted text<br /><br /> <code>&lt;q&gt;</code> Defines a short quotation<br /><br /> <code>&lt;samp&gt;</code> Defines sample computer code text<br /><br /> <code>&lt;small&gt;</code> Defines small text<br /><br /> <code>&lt;span&gt;</code> Defines a section in a document<br /><br /> <code>&lt;s&gt;</code> Defines strikethrough text<br /><br /> <code>&lt;strike&gt;</code> Defines strikethrough text <br /><br /> <code>&lt;strong&gt;</code> Defines strong text <br /><br /> <code>&lt;sub&gt;</code> Defines subscripted text <br /><br /> <code>&lt;sup&gt;</code> Defines superscripted text <br /><br /> <code>&lt;u&gt;</code> Defines underlined text<br /><br /></p> </div> </div><!-- /end inline_mailinglist--> <div id='inlineCommenting' style='padding:10px;' class="markdown"> <p><i>Dr. Dobb's</i> encourages readers to engage in spirited, healthy debate, including taking us to task. However, <i>Dr. Dobb's</i> moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. <i>Dr. Dobb's</i> further reserves the right to disable the profile of any commenter participating in said activities.</p> </div> </div> <table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#f3f3f3"> <tr> <td colspan="2">&nbsp;</td> </tr> <tr> <td width="34"><img src="https://twimgs.com/informationweek/Disqus_art/hintbox_info.jpg" alt="Disqus Tips" border="0" align="left" height="34"></td> <td><font style="font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; color: #000000; font-size: 11px;"> <strong>To upload an avatar photo,</strong> first <a href="https://disqus.com/dashboard/" style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; color: #003bb0; font-size: 11px;" target="_blank">complete your Disqus profile.</a> | <a href="#" class="htmlTags" style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; color: #003bb0; font-size: 11px;">View the list</a> of <strong>supported HTML tags</strong> you can use to style comments. | Please read our <a href="#" class="commentingPolicy" style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; color: #003bb0; font-size: 11px;"><strong>commenting policy.</strong></a> </font> </td> </tr> <tr> <td colspan="2">&nbsp;</td> </tr> </table> </div> <div id="mythread"> </div> <script language='JavaScript' type='text/javascript'> <!-- var jmessage = ''; var jtimestamp = ''; var jhmac = ''; var jmessage = ''; var isLoggedIn = ''; $.ajax({ type: "GET", url: "/disqussetting", data: "referer="+encodeURIComponent(window.location.href), success: function(data){ if (data != null) { jmessage = data.jmessage; jtimestamp = data.jtimestamp; jhmac = data.jhmac; isLoggedIn = data.isLoggedIn; if(!isLoggedIn) // do only if he is not logged in { $('#mythread').load('/disqus/showcomments/format/html', {'success':encodeURIComponent(window.location.href), 'articleId': '184404580', 'assetId': '156622', 'actionType' : '' }); } } }, dataType: "json", async: false, cache: false } ); if(jhmac == null || jhmac == ''){ var headID = document.getElementsByTagName("head")[0]; var cssNode = document.createElement('link'); cssNode.type = 'text/css'; cssNode.rel = 'stylesheet'; cssNode.href = 'https://i.techweb.com/brainyard/css/disqusLoggedOff.css'; cssNode.media = 'screen'; headID.appendChild(cssNode); } else { document.write("<style type=\"text/css\">#techwebCommentLogin{display:none;}</style>"); } --> </script> <script type="text/javascript"> if (jmessage == null) $("div#disqus-hints-box").hide(); </script> <script type="text/javascript"> var disqus_config = function () { var hmac1 = jhmac; var htimestamp = jtimestamp; var hmessage = jmessage; if(hmac1 != null){ this.page.remote_auth_s3 = hmessage + ' ' + hmac1 + ' ' + htimestamp; this.page.api_key = "Qq6ImCn7MIzMK699FJY4iuhauNLipx3XghP08sjP0Wz9Ipk81mTrcqxz85A8OOqv"; } this.sso = { name: "UBM TechWeb", button: "http://i.techweb.com/informationweek/images/ubm-techweb-logo.gif", icon: "http://i.cmpnet.com/brainyard/images/favicon.ico", url: "javascript:NextGen.disqusCommentForm('http://drdobbs.com/login?assetId=156622&k=2LGCMTDD&successfulLoginRedirect=http%3A%2F%2Fdrdobbs.com%2Fprofiling-in-perl%2F184404580');", logout: "http://drdobbs.com/logout?redirect=http%3A%2F%2Fdrdobbs.com%2Fprofiling-in-perl%2F184404580", width: "800", height: "400" }; this.callbacks.onNewComment = [function() {trackComment();}]; }; </script> <style type="text/css"> .dsq-post-tools .dsq-post-as .dsq-button{ background: url(none); background-color:#c90000; } .dsq-post-tools .dsq-post-as .dsq-button:active{ background: url(none); background-color:#ed0404; } .dsq-post-tools .dsq-post-as .dsq-button:hover{ background: url(none); background-color:#e00000; } .dsq-post-tools .dsq-post-as .dsq-button{ text-shadow:none; color:white; } .dsq-comment-text blockquote{ border-left:1px solid #555555; padding-left:15px; padding-top:5px; padding-bottom:5px; font-style:italic; font-size:15px; margin:15px; color:#999999; margin-bottom:10px; padding-right:15px; font-weight:bold; } #dsq-content .dsq-comment-meta li, #dsq-content .dsq-comment-actions li { float: left; font-size: 65%; margin: 0 10px 0 0; } #dsq-content #dsq-footer li { float: left; font-size: 0.75em; margin: 0 10px 0 0; } #dsq-content .dsq-comment-text { display: inline; /* font-size: .80em; */ } </style> <a name="comments"></a> <div id="disqus_thread"> </div> <script type="text/javascript"> if(isLoggedIn) { var disqus_developer = 1; var disqus_shortname = 'drdobbs'; var disqus_domain = 'disqus.com'; var disqus_identifier = 'article_184404580'; var disqus_url = 'http://drdobbs.com/profiling-in-perl/184404580'; var disqus_title = '"Profiling in Perl"'; if(disqus_identifier !== null && disqus_identifier != '') { /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); } } </script> </div> <!-- / Commenting --> </div> </div> </div> <!-- Finally, to actually run the highlighter, you need to include this JS on your page --> <script type="text/javascript"> SyntaxHighlighter.all(); </script> </div> <script>var ngGatedContentPage = '1';</script> <div id="right-col"> <!-- div class="subsection " --> <!-- /div --> <script type='text/javascript'> if (document.documentElement.clientWidth > 767){ document.write('<div id="div-gpt-ad-942957474691236830-4">'); googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-4'); }); document.write('</div>'); } </script> <!-- <br/><br/> <div class="subsection sponsored-content"> --> <!-- ?php echo $this->render('/shared/right/articlepremiumcontent.phtml')? --> <!-- </div> --> <div class="recent-articles non-mobile-unit"> <h2> Recent Articles</h2> <ul> <li><a href="/architecture-and-design/dr-dobbs-archive/240169474" class="contentgating_article">Dr. Dobb's Archive</a></li> <li><a href="/architecture-and-design/farewell-dr-dobbs/240169421" class="contentgating_article">Farewell, <em>Dr. Dobb's</em></a></li> <li><a href="/joltawards/jolt-awards-2015-coding-tools/240169420" class="contentgating_article">Jolt Awards 2015: Coding Tools</a></li> <li><a href="/architecture-and-design/thriving-among-the-apis/240169441" class="contentgating_article">Thriving Among the APIs</a></li> <li><a href="/web-development/the-long-death-of-project-hosting-sites/240169394" class="contentgating_article">The Long Death of Project Hosting Sites</a></li> </ul> </div> <span class="non-mobile-unit"> <div class="subsection mostpopular"> <h2>Most Popular</h2> <div class="tab_controls"> <a id="articles" class="current" href="#">Stories</a> <a id="blogs" href="#">Blogs</a> </div> <div id="mostpopular" class="box_wrap"> <ul> <li> <a name="dobbs-callout-mostpop" href="/web-development/restful-web-services-a-tutorial/240169069" class="contentgating_article">RESTful Web Services: A Tutorial</a> </li> <li> <a name="dobbs-callout-mostpop" href="/jvm/lambda-expressions-in-java-8/240166764" class="contentgating_article">Lambda Expressions in Java 8</a> </li> <li> <a name="dobbs-callout-mostpop" href="/tools/developer-reading-list-the-must-have-boo/240148421" class="contentgating_article">Developer Reading List: The Must-Have Books for JavaScript</a> </li> <li> <a name="dobbs-callout-mostpop" href="/jvm/an-algorithm-for-compressing-space-and-t/184406478" class="contentgating_article">An Algorithm for Compressing Space and Time</a> </li> <li> <a name="dobbs-callout-mostpop" href="/jvm/why-build-your-java-projects-with-gradle/240168608" class="contentgating_article">Why Build Your Java Projects with Gradle Rather than Ant or Maven?</a> </li> <li> <a name="dobbs-callout-mostpop" href="/" class="contentgating_article"></a> </li> <li> <a name="dobbs-callout-mostpop" href="/" class="contentgating_article"></a> </li> </ul></div> <div id="mostpopular" class="box_wrap" style="display: none;"> <ul> <li> <a name="dobbs-callout-mostpop-blog" href="/jvm/readwrite-properties-files-in-java/231000005" class="contentgating_article">Read/Write Properties Files in Java</a> </li> <li> <a name="dobbs-callout-mostpop-blog" href="/jvm/coding-the-javafx-tableview/240001874" class="contentgating_article">Coding the JavaFX TableView</a> </li> <li> <a name="dobbs-callout-mostpop-blog" href="/jvm/easy-dom-parsing-in-java/231002580" class="contentgating_article">Easy DOM Parsing in Java</a> </li> <li> <a name="dobbs-callout-mostpop-blog" href="/cpp/c11-uniqueptr/240002708" class="contentgating_article">C++11: unique_ptr</a> </li> <li> <a name="dobbs-callout-mostpop-blog" href="/jvm/making-http-requests-from-java/240160966" class="contentgating_article">Making HTTP Requests From Java</a> </li> <li> <a name="dobbs-callout-mostpop-blog" href="/" class="contentgating_article"></a> </li> <li> <a name="dobbs-callout-mostpop-blog" href="/" class="contentgating_article"></a> </li> </ul></div> </div> <div class="box video"> </div> <div class="subsection sponsored-content"> <style> #right-col .subsection .sponsored{ font-size: 0.7em !important; } </style> <h2>This month's Dr. Dobb's Journal</h2> <div class="sponsored"> <div class="whitepaper"> <div align="center"> <a href="/digital/20141022?k=ddjtm&cid=onedit_ds_ddjtm"> <img height="115" width="190" border="0" alt="Dr. Dobb's Digital Digest - October 2014" src="http://thewallstreetwiki.com/_art/DrDobbs_10_22_Cover.jpg"> </a> </div> <p> <a href="/digital/20141022?k=ddjtm&cid=onedit_ds_ddjtm"><b>This month</b></a>, Dr. Dobb's Journal is devoted to mobile programming. We introduce you to Apple's new Swift programming language, discuss the perils of being the third-most-popular mobile platform, revisit SQLite on Android , <b><a href="/digital/20141022?k=ddjtm&cid=onedit_ds_ddjtm">and much more!</a></b><br><br> <a href="/digital/20141022?k=ddjtm&cid=onedit_ds_ddjtm">Download the latest issue today. &gt;&gt;</a> </p> </div> </div> </div> <div id='div-gpt-ad-942957474691236830-5'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-5'); }); </script> </div> </span> <!-- Upcoming Events --> <style> #upcoming_tabs .tab-content { border: 1px solid #5F953C; border-top: none; margin-top: -10px; width: 323px; font-size: 12px; padding: 20px 5px 10px; } #upcoming_tabs .tab-content li { margin: 0 15px; list-style: none; } #upcoming_tabs .tab-content p { margin: 0 10px; } #upcoming_tabs .tab-content p img { max-width: 100px; margin-bottom: 5px; } #upcoming_tabs .tab-content a { font-size: 12px; font-weight: normal; } </style> <div class="subsection"> <h2>Upcoming Events</h2> <div id="upcoming_tabs"> <div class="tab_controls"> <a title="Live Events" href="#tab_live-events">Live Events</a> <a title="WebCasts" href="#tab_webcasts">WebCasts</a> </div> <div class="tab-content" style="display: block;" id="tab_live-events"> <!-- Taxonomy ID: --><!--not from cache.cache key-->No records found </div> <div class="tab-content" style="display: none;" id="tab_webcasts"> <!-- Taxonomy ID: --><!--not from cache.cache key--> <!-- Taxonomy ID: --> <li><!--Rule 10 --><a target="_new" href="https://iw-resources.informationweek.com/c/pubRD.mpl?secure=1&sr=pp&_t=pp:&qf=w_defa4728&ch=sbx&cid=SBX_ddj_fture_Webcast_default_profiling_in_perl&itc=SBX_ddj_fture_Webcast_default_profiling_in_perl&K=SBX_DDJ_FT">Cyber Resiliency 2023: How to Keep IT Operations Running, No Matter What</a> </li> <li><!--Rule 10 --><a target="_new" href="https://networkcomputing.tradepub.com/c/pubRD.mpl?secure=1&sr=pp&_t=pp:&qf=w_defa4434&ch=sbx&cid=SBX_ddj_fture_Webcast_default_profiling_in_perl&itc=SBX_ddj_fture_Webcast_default_profiling_in_perl&K=SBX_DDJ_FT">Changing Network Architecture Investments</a> </li> <li><!--Rule 10 --><a target="_new" href="https://webinar.darkreading.com/1328658?keycode=sbx&cid=SBX_ddj_fture_Webcast_default_profiling_in_perl&itc=SBX_ddj_fture_Webcast_default_profiling_in_perl&K=SBX_DDJ_FT">Incorporating a Prevention Mindset into Threat Detection and Response</a> </li> <li><!--Rule 10 --><a target="_new" href="https://webinar.darkreading.com/1296129?keycode=sbx&cid=SBX_ddj_fture_Webcast_default_profiling_in_perl&itc=SBX_ddj_fture_Webcast_default_profiling_in_perl&K=SBX_DDJ_FT">Making Deception a Part of Your Enterprise Defense Strategy</a> </li> <li><!--Rule 10 --><a target="_new" href="https://vts.informaengage.com/dark-reading-cybersecurity-technology-where-its-going-and-how-to-get-there/?kcode=sbx&cid=SBX_ddj_fture_Webcast_default_profiling_in_perl&itc=SBX_ddj_fture_Webcast_default_profiling_in_perl&K=SBX_DDJ_FT">Cybersecurity Tech: Where It's Going and How To Get There</a> </li> <br> <br> <div class="sbarchive_bottomleft"><a href="/webcast/all/more.html?cid=SBX_ddj_fture_Webcast_default_profiling_in_perl?itc=SBX_ddj_fture_Webcast_default_profiling_in_perl" class="continue">More Webcasts<span>>></span></a></div> <!-- Render Assets of CurationType 'Webcast' --> </div> </div><!--/upcoming_border--> </div><!--/upcoming--> <script type="text/javascript"> $(document).ready(function(){ $('#upcoming_tabs .tab-content').hide(); $('#upcoming_tabs .tab-content:first').show(); $('#upcoming_tabs .tab_controls a:first').addClass('current'); $('#upcoming_tabs .tab_controls a').click(function(){ $('#upcoming_tabs .tab_controls a').removeClass('current'); $(this).addClass('current'); var currentTab = $(this).attr('href'); $('#upcoming_tabs .tab-content').hide(); $(currentTab).show(); return false; }); }); </script> <div class="recent-articles"> <div id="smartbox"> <h2>Featured Reports</h2> <div class="bar" style="padding-top:8px;padding-bottom:8px;">&nbsp; <div class="left">&nbsp;</div> <div class="right"><a title="UBM Smart boxes auto deliver premium content that is contextually relevant to the article or site section where it is located" href="#">What's this?</a></div> </div> <div class="resources clearfix"> <!-- Taxonomy ID: --><!--not from cache.cache key--> <!-- Taxonomy ID: --> <ul class="archive"> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/executive-insights-and-innovation/it-strategy/2021-digital-transformation-report/428703?cid=SBX_ddj_fture_Analytics_default_profiling_in_perl&itc=SBX_ddj_fture_Analytics_default_profiling_in_perl"> 2021 Digital Transformation Report </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/risk-management-security/forrester-total-economic-impact%E2%84%A2-study-team-cymru-pure-signal%E2%84%A2-recon/429373?cid=SBX_ddj_fture_Analytics_default_profiling_in_perl&itc=SBX_ddj_fture_Analytics_default_profiling_in_perl"> Forrester Total Economic Impact Study: Team Cymru Pure Signal Recon </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/cloud-security/sans-2021-cloud-security-survey/429583?cid=SBX_ddj_fture_Analytics_default_profiling_in_perl&itc=SBX_ddj_fture_Analytics_default_profiling_in_perl"> SANS 2021 Cloud Security Survey </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/network-and-perimeter-security/cloud-infrastructure/the-infoblox-q1-2021-cyberthreat-intelligence-report/429503?cid=SBX_ddj_fture_Analytics_default_profiling_in_perl&itc=SBX_ddj_fture_Analytics_default_profiling_in_perl"> The Infoblox Q1 2021 Cyberthreat Intelligence Report </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://informationweek.com/whitepaper/software/information-management/forrester-report-the-total-economic-impactandtrade-of-bizagi%E2%80%99s-low-code-intelligent-process-automation-platform/429123?cid=SBX_ddj_fture_Analytics_default_profiling_in_perl&itc=SBX_ddj_fture_Analytics_default_profiling_in_perl"> Forrester Report: The Total Economic Impact Of Bizagi's Low-Code Intelligent Process Automation Platform </a> </li> </ul> <div class="left" style="margin-left: 28px !important;font-family: verdana;font-size: 10px;"><a href="/analytics/all/more.html?cid=SBX_ddj_fture_Analytics_default_profiling_in_perl?itc=SBX_ddj_fture_Analytics_default_profiling_in_perl">More >></a></div> <div class="right"><img src="https://twimgs.com/informationweek/smartbox/images/smartbox.PNG"></div> </div> </div> <br> <div id="smartbox"> <h2>Featured Whitepapers</h2> <div class="bar" style="padding-top:8px;padding-bottom:8px;">&nbsp; <div class="left">&nbsp;</div> <div class="right"><a title="UBM Smart boxes auto deliver premium content that is contextually relevant to the article or site section where it is located" href="#">What's this?</a></div> </div> <div class="resources clearfix"> <!-- Taxonomy ID: --><!--not from cache.cache key--> <!-- Taxonomy ID: --> <ul class="archive"> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/security-management-and-analytics/cybersecurity/modernize-your-security-operations-with-human-machine-intelligence/438993?cid=SBX_ddj_fture_wp_default_profiling_in_perl&itc=SBX_ddj_fture_wp_default_profiling_in_perl"> Modernize your Security Operations with Human-Machine Intelligence </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/security-monitoring/quantifying-the-gap-between-perceived-security-and-comprehensive-mitre-attandck-coverage/436503?cid=SBX_ddj_fture_wp_default_profiling_in_perl&itc=SBX_ddj_fture_wp_default_profiling_in_perl"> Quantifying the Gap Between Perceived Security and Comprehensive MITRE ATT&CK Coverage </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/security/selling-breaches-the-transfer-of-enterprise-network-access-on-criminal-forums/436623?cid=SBX_ddj_fture_wp_default_profiling_in_perl&itc=SBX_ddj_fture_wp_default_profiling_in_perl"> Selling Breaches: The Transfer of Enterprise Network Access on Criminal Forums </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/security/building-immunity-the-2021-healthcare-and-pharmaceutical-industry-cyber-threat-landscape-report/436553?cid=SBX_ddj_fture_wp_default_profiling_in_perl&itc=SBX_ddj_fture_wp_default_profiling_in_perl"> Building Immunity: The 2021 Healthcare and Pharmaceutical Industry Cyber Threat Landscape Report </a> </li> <li><!--Rule 10 --> <a target="_new" href="https://www.informationweek.com/whitepaper/cybersecurity/risk-management-security/managed-security-and-the-3rd-party-cyber-risk-opportunity-whitepaper/436183?cid=SBX_ddj_fture_wp_default_profiling_in_perl&itc=SBX_ddj_fture_wp_default_profiling_in_perl"> Managed Security and the 3rd Party Cyber Risk Opportunity Whitepaper </a> </li> </ul> <div class="left" style="margin-left: 28px !important;font-family: verdana;font-size: 10px;"><a href="/whitepaper/all/more.html?cid=SBX_ddj_fture_wp_default_profiling_in_perl?itc=SBX_ddj_fture_wp_default_profiling_in_perl">More >></a></div> <div class="right"><img src="https://twimgs.com/informationweek/smartbox/images/smartbox.PNG"></div> </div> </div> <br> </div> <div class="subsection mostrecent non-mobile-unit"> <h2>Most Recent Premium Content</h2> <div class="tab_controls"> <a class="current" href="/digitaledition/">Digital Issues</a> </div> <div class="box_wrap"> <ul> <b>2014</b><br /> <b>Dr. Dobb's Journal</b> <li><a href="https://www.drdobbs.com/digital/20141022">November - <strong>Mobile Development</strong></a></li> <li><a href="https://dc.ubm-us.com/i/350594">August - <strong>Web Development</strong></a></li> <li><a href="https://dc.ubm-us.com/i/300036/">May - <strong>Testing</strong></a></li> <li><a href="https://dc.ubm-us.com/i/245989">February - <strong>Languages</strong></a></li> <br /> <b>Dr. Dobb's Tech Digest</b><br> <li><a href="https://www.drdobbs.com/digital/20140813">DevOps</a></li> <li><a href="https://www.drdobbs.com/digital/20140626">Open Source</a></li> <li><a href="https://www.drdobbs.com/digital/20140514/">Windows and .NET programming</a></li> <li><a href="https://www.drdobbs.com/digital/012914/">The Design of Messaging Middleware and 10 Tips from Tech Writers</a></li> <li><a href="https://www.drdobbs.com/digital/022614">Parallel Array Operations in Java 8 and Android on x86: Java Native Interface and the Android Native Development Kit</a></li> <br /> <b>2013</b> <li><a href="https://www.drdobbs.com/digital/121712/?cid=ddj_premium_January2013">January - <strong>Mobile Development</strong></a></li> <li><a href="https://www.drdobbs.com/digital/012213/?cid=ddj_premium_February2013">February - <strong>Parallel Programming</strong></a></li> <li><a href="https://www.drdobbs.com/digital/022513/?cid=ddj_premium_March2013">March - <strong>Windows Programming</strong></a></li> <li><a href="https://www.drdobbs.com/digital/032513/?cid=ddj_premium_April2013">April - <strong>Programming Languages</strong></a></li> <li><a href="https://www.drdobbs.com/digital/042213/?cid=ddj_premium_May2013">May - <strong>Web Development</strong></a></li> <li><a href="https://www.drdobbs.com/digital/052013/?cid=ddj_premium_June2013">June - <strong>Database Development</strong></a></li> <li><a href="https://www.drdobbs.com/digital/062413/?cid=ddj_premium_July2013">July - <strong>Testing</strong></a></li> <li><a href="https://www.drdobbs.com/digital/072213/?cid=ddj_premium_August2013">August - <strong>Debugging and Defect Management</strong></a></li> <li><a href="https://www.drdobbs.com/digital/082613">September - <strong>Version Control</strong></a></li> <li><a href="https://www.drdobbs.com/digital/092313/">October - <strong>DevOps</strong></a></li> <li><a href="https://www.drdobbs.com/digital/102113">November- <strong>Really Big Data</strong></a></li> <li><a href="https://www.drdobbs.com/digital/111113?k=ddjtm&cid=onedit_ds_ddjtm">December - <strong>Design</strong></a></li> <br> <b>2012</b> <li><a href="https://www.drdobbs.com/digital/121911/?cid=ddj_premium_January2012">January - <strong>C & C++</strong></a></li> <li><a href="https://www.drdobbs.com/digital/011912/?cid=ddj_premium_February2012">February - <strong>Parallel Programming</strong></a></li> <li><a href="https://www.drdobbs.com/digital/021912/?cid=ddj_premium_March2012">March - <strong>Microsoft Technologies</strong></a></li> <li><a href="https://www.drdobbs.com/digital/031912/?cid=ddj_premium_April2012">April - <strong>Mobile Development</strong></a></li> <li><a href="https://www.drdobbs.com/digital/042312/?cid=ddj_premium_May2012">May - <strong>Database Programming</strong></a></li> <li><a href="https://www.drdobbs.com/digital/052112/?cid=ddj_premium_June2012">June - <strong>Web Development</strong></a></li> <li><a href="https://www.drdobbs.com/digital/061812/?cid=ddj_premium_July2012">July - <strong>Security</strong></a></li> <li><a href="https://www.drdobbs.com/digital/072312/?cid=ddj_premium_August2012">August - <strong>ALM & Development Tools</strong></a></li> <li><a href="https://www.drdobbs.com/digital/082012/?cid=ddj_premium_September2012">September - <strong>Cloud & Web Development</strong></a></li> <li><a href="https://www.drdobbs.com/digital/092412/?cid=ddj_premium_October2012">October - <strong>JVM Languages</strong></a></li> <li><a href="https://www.drdobbs.com/digital/102212/?cid=ddj_premium_November2012">November - <strong>Testing</strong></a></li> <li><a href="https://www.drdobbs.com/digital/111912/?cid=ddj_premium_December2012">December - <strong>DevOps</strong></a></li> <br /> </ul> </div> </div> </div> <script src="https://content.dl-rms.com/rms/19467/nodetag.js"></script> <div id="bottom" align="center" style="clear: both;"> <div id='div-gpt-ad-942957474691236830-29'> <script type='text/javascript'> googletag.cmd.push(function(){ googletag.display('div-gpt-ad-942957474691236830-29'); }); </script> </div> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-MMJM4JC');</script> <!-- End Google Tag Manager --> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MMJM4JC" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://twimgs.com/nojitter/css/common-footer.css?v2" /> <style type="text/css"> @media (min-width: 992px){ .col-md-5.brand-name { width:27%; } } </style> <script type="text/javascript"> var _elqQ = _elqQ || []; _elqQ.push(['elqSetSiteId', '2150']); _elqQ.push(['elqUseFirstPartyCookie', 'trk.drdobbs.com']); _elqQ.push(['elqTrackPageView']); (function() { function async_load() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//img.en25.com/i/elqCfg.min.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if(window.addEventListener) window.addEventListener('DOMContentLoaded', async_load, false); else if (window.attachEvent) window.attachEvent('onload', async_load); })(); </script> <footer style="position: absolute; width: 100%; left: 0;"> <div class="divisional-footer"> <div class="divisional-footer-container"> <!--divisional plus marketing --> <div class="alternate"> <div class="footer-row" style="border-bottom: 1px solid #fff;"> <div class="col-md-5 discover"> <div class="heading">Discover more from Informa Tech</div> <ul class="list-inline"> <li><a href="https://www.informationweek.com/" title="InformationWeek">InformationWeek</a></li> <li><a href="https://www.interop.com/" title="Interop">Interop</a></li> <li><a href="https://www.darkreading.com/" title="Dark Reading">Dark Reading</a></li> <li><a href="https://www.datacenterknowledge.com/" title="Data Center Knowledge">Data Center Knowledge</a></li> <li><a href="https://www.networkcomputing.com/" title="Network Computing">Network Computing</a></li> <li><a href="https://www.itprotoday.com/" title="IT Pro Today">IT Pro Today</a></li> </ul> </div> <div class="col-md-2 working"> <div class="heading">Working With Us</div> <ul class="list-inline"> <li style="width:96%"><a href="https://informationweek.com/about-us/d/d-id/705542">Contact Us</a></li> <li style="width:96%"><a href="https://informationweek.com/document.asp?doc_id=705542">About Us</a></li> <li style="width:96%"><a href="https://informationweek.com/document.asp?doc_id=1334603">Advertise</a></li> <li style="width:96%"><a target="_blank" href="https://info.wrightsmedia.com/informa-licensing-reprints-request">Reprints</a></li> </ul> </div> <div class="col-md-5 brand-name"> <div class="heading">Follow Dr. Dobb's on Social </div> <ul class="list-inline social-icon"> <li> <a href="https://www.facebook.com/informationweek"> <i class="facebook-white trigger-sc-event" data-goal-id="715A59A2-A9FC-44E0-B4AF-8A960F2A5116"></i> </a> </li> <li> <a href="https://twitter.com/InformationWeek"> <i class="twitter-white trigger-sc-event" data-goal-id="715A59A2-A9FC-44E0-B4AF-8A960F2A5116"></i> </a> </li> <li> <a href="https://www.linkedin.com/company/3930/admin/"> <i class="linkedin-white trigger-sc-event" data-goal-id="715A59A2-A9FC-44E0-B4AF-8A960F2A5116"></i> </a> </li> <li> <a href="https://www.drdobbs.com/rss/">&nbsp; <i class="rss-feed-white trigger-sc-event" data-goal-id="715A59A2-A9FC-44E0-B4AF-8A960F2A5116"></i> </a> </li> </ul> </div> </div> </div> <!--DIV--> </div> </div> <div class="divisional-footer"> <div class="divisional-footer-container"> <div class="footer-row footer-icons"> <div class="col-md-5 logo"> <img src="https://twimgs.com/nojitter/img/Whitelogo.png" alt="alt text of the logo"> </div> <div class="col-md-7" style="padding:0;margin:0;"> <ul class="list-inline"> <li><a target="_blank" href="https://tech.informa.com/">Home</a></li> <li><a target="_blank" href="https://tech.informa.com/cookie-policy">Cookie Policy</a></li> <li><a target="_blank" href="https://privacyportal-eu-cdn.onetrust.com/dsarwebform/c1f53e84-9f05-4169-a854-85052b63c50b/5f26b553-52cc-4973-a761-295d5634a6b6.html">CCPA: Do not sell my personal info</a></li> <li><a target="_blank" href="https://tech.informa.com/privacy-policy">Privacy</a></li> <li><a target="_blank" href="https://tech.informa.com/terms-and-conditions">Terms</a></li> </ul> </div> </div> <div class="footer-row privacy-policy"> <div class="col-md-12"> <p class="copyright" style="margin-left: -20px;">Copyright 漏 2025 Informa PLC. Informa PLC is registered in England and Wales with company number 8860726 whose registered and head office is 5 Howick Place, London, SW1P 1WG. </p> </div> </div> </div> </div> </footer> </div> </div> </div> <script type="text/javascript"> var disqus_shortname = 'drdobbs'; var disqus_developer = 1; /* * * DON'T EDIT BELOW THIS LINE * * */ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = 'https://' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); </script> <!-- SiteCatalyst code version: H.16. Copyright 1997-2008 Omniture, Inc. More info available at https://www.omniture.com --> <script type="text/javascript" src="https://twimgs.com/custom/library.gtecevent.com/assets/ubm-tech-global-app-measurement.js?ormzkk" ></script> <script language='JavaScript' type='text/javascript'> var referer = ''; var eVar23 = ''; var slr=""; var host=""; var userAgent = ''; $.ajax({ type: "GET", url: host+"/omniture", data: "referer="+slr+encodeURIComponent(document.referrer), success: function(data){ if (data != null) { referer = data.referer; eVar23 = data.eVar23; userAgent = data.userAgent; } }, dataType: "json", async: false, cache: false } ); </script> <script language='JavaScript' type='text/javascript'> <!-- s.pageURL="http://drdobbs.com/profiling-in-perl/184404580"; s.pageName=""; s.referrer=referer; s.server=""; s.channel="drdobbs.com.com/profiling-in-perl"; s.pageType=""; s.prop1=""; s.prop2="184404580"; s.prop3="Dr. Dobb's Journal | 184404580 | Profiling in Perl"; s.prop4="Profiling in Perl"; s.prop5="profiling-in-perl"; s.prop6=""; s.prop7="brian d foy"; s.prop8=userAgent; s.prop9=""; s.prop10="complete"; s.prop11="Feature"; s.prop12=""; s.prop14=""; s.prop15=""; s.prop16=""; s.prop19="False"; s.prop20="20010409"; s.prop21=""; /* Conversion Variables */ s.campaign=""; s.state=""; s.zip=""; s.events=""; s.products=""; s.purchaseID=""; s.eVar1=""; s.eVar2=""; s.eVar3=""; s.eVar4=""; s.eVar5=""; s.eVar6=""; s.eVar8=""; s.eVar21=""; s.eVar22=""; s.eVar23=eVar23; s.eVar31="Related Reading|Insights|Events|Reports|Whitepapers"; /************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/ var s_code=s.t();if(s_code)document.write(s_code)//--> </script> <noscript><a href="https://www.omniture.com" title="Web Analytics"><img src="https://cmpglobalvista.112.2O7.net/b/ss/cmpglobalvista/1/H.16--NS/0" height="1" width="1" border="0" alt="" /></a></noscript><!--/DO NOT REMOVE/--> <script language="JavaScript" type="text/javascript"> function trackComment(){ var s=s_gi('cmpglobalvista'); s.evar24=s.prop7 +" | "+ s.prop4; s.events='event8'; s.tl(this,'o','Article Comment Posted'); } </script> <!-- End SiteCatalyst code version: H.16 --><!-- Google Code for Remarketing Tag --> <!-------------------------------------------------- Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup ---------------------------------------------------> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 1007530244; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1007530244/?guid=ON&amp;script=0"/> </div> </noscript></body> </html>

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