<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DistributedInformation &#187; perl</title>
	<atom:link href="http://fosiki.com/blog/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://fosiki.com/blog</link>
	<description>Sven Dowideit - Consulting Wiki Engineer</description>
	<lastBuildDate>Sat, 14 Aug 2010 03:40:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>A surprise move for the not quite open source project TWiki &#8211; kick people out of the dev mailing list</title>
		<link>http://fosiki.com/blog/2010/05/23/a-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list/</link>
		<comments>http://fosiki.com/blog/2010/05/23/a-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list/#comments</comments>
		<pubDate>Sun, 23 May 2010 01:25:02 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[new]]></category>
		<category><![CDATA[enterprise wiki]]></category>
		<category><![CDATA[foswiki]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://fosiki.com/blog/2010/05/23/a-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list/</guid>
		<description><![CDATA[I guess having other people see what you&#8217;re working on is too threatening for the not-quite open source project TWiki. It seems that allot of the developers that moved their main attention from TWiki to Foswiki have been kicked out of the public mailing list without warning, explanation or permission. I guess its somewhat consistent [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:eb59ac018f10f9f15bcc8617a3e55cfe616aff9d'><p>I guess having other people see what you&#8217;re working on is too threatening for the not-quite open source project TWiki.</p>
<p>It seems that allot of the developers that moved their main attention from TWiki to Foswiki have been kicked out of the public mailing list without warning, explanation or permission.</p>
<p>I guess its somewhat consistent with the password protection of the irc logs of the #twiki channel on Freenode (snigger).</p>
<p>I initially though that my mailing list password had been hacked, or maybe theirs, but thinking further, it feels consistent with the lack of deep understanding of the idea of &#8216;open&#8217;</p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2010%2F05%2F23%2Fa-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list%2F&amp;title=A+surprise+move+for+the+not+quite+open+source+project+TWiki+%26%238211%3B+kick+people+out+of+the+dev+mailing+list" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2010/05/23/a-surprise-move-for-the-not-quite-open-source-project-twiki-kick-people-out-of-the-dev-mailing-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strawberry Perl rocks Windows.</title>
		<link>http://fosiki.com/blog/2008/12/09/strawberry-perl-rocks-windows/</link>
		<comments>http://fosiki.com/blog/2008/12/09/strawberry-perl-rocks-windows/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 06:22:06 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[enterprise]]></category>
		<category><![CDATA[foswiki]]></category>
		<category><![CDATA[nextwiki]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[twikiapplication]]></category>
		<category><![CDATA[twikifork]]></category>
		<category><![CDATA[wiki]]></category>
		<category><![CDATA[enterprise wiki]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[strawberry perl]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://fosiki.com/blog/?p=179</guid>
		<description><![CDATA[if you&#8217;re working or just running Perl on Windows, drop everything, run, don&#8217;t walk, to StrawberryPerl. Adam Kennedy has not only made a real Perl for windows, he&#8217;s made a _proper_ Perl . One where CPAN just plain works. Even better, he&#8217;s made a Perl that you can use portably, from your USB stick, so [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:524e22c20e382b4a0a563458fe596c41249f6b67'><p>if you&#8217;re working or just running Perl on Windows, drop everything, run, don&#8217;t walk, to <a href="http://strawberryperl.com/">StrawberryPerl</a>. Adam Kennedy has not only made a real Perl for windows, he&#8217;s made a _<em>proper</em>_ Perl . One where CPAN just plain works.</p>
<p>Even better, he&#8217;s made a Perl that you can use portably, from your USB stick, so you don&#8217;t even need to install Perl on your locked down computer.</p>
<p>To learn about his code, I&#8217;m building a <a href="http://foswiki.org/Development/FoswikiOnAStick">FoswikiOnAStick</a> distro based on his code, and then I hope to work out how to extend the concept to other platforms.</p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F12%2F09%2Fstrawberry-perl-rocks-windows%2F&amp;title=Strawberry+Perl+rocks+Windows." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2008/12/09/strawberry-perl-rocks-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ever had Perl CPAN not work on your debian, even though you installed make etc?</title>
		<link>http://fosiki.com/blog/2008/08/20/ever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc/</link>
		<comments>http://fosiki.com/blog/2008/08/20/ever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 06:29:00 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[dtrace]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[make]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/?p=69</guid>
		<description><![CDATA[CPAN, while incredibly useful, can be a pain, if you forget that you need to re-configure it after installing essential tools. For example, if you make the mistake of setting up a basic, non-development Debian virtual machine, configure CPAN, try to use it, and on seeing &#8216;make&#8217; errors like (from install Bundle::CPAN of all things) [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:ce9f993266f5f921264bab12972452c20ebec23e'><p>CPAN, while incredibly useful, can be a pain, if you forget that you need to re-configure it after installing essential tools.</p>
<p>For example, if you make the mistake of setting up a basic, non-development Debian virtual machine, configure CPAN, try to use it, and on seeing &#8216;make&#8217; errors like (from <code>install Bundle::CPAN</code> of all things) :<br />
<code><br />
Running make test<br />
  Can't test without successful make<br />
Running make install<br />
  make had returned bad status, install seems impossible<br />
Running install for module Compress::Raw::Zlib<br />
Running make for P/PM/PMQS/Compress-Raw-Zlib-2.012.tar.gz<br />
  Is already unwrapped into directory /root/.cpan/build/Compress-Raw-Zlib-2.012<br />
  Has already been processed within this session<br />
Running make test<br />
  Can't test without successful make<br />
Running make install<br />
  make had returned bad status, install seems impossible<br />
Running make for P/PM/PMQS/IO-Compress-Zlib-2.012.tar.gz<br />
  Is already unwrapped into directory /root/.cpan/build/IO-Compress-Zlib-2.012<br />
  Has already been processed within this session<br />
Running make test<br />
  Can't test without successful make<br />
Running make install<br />
  make had returned bad status, install seems impossible</p>
<p>cpan><br />
</code></p>
<p>You install make <code>apt-get update ; apt-get install build-essential</code>&#8230;, only to continue to see the same errors wizz past&#8230;.</p>
<p>CPAN really truly needs to realise that the make settings are mis configured, and tell you.</p>
<p>What you <em>need</em> to do, is to tell your cpan about it by running:<br />
<code>cpan> o conf init</code></p>
<p>OR, if you&#8217;ve not yet messed (configured) up your cpan, install <code>build-essential</code> first.</p>
<p>And while you&#8217;re contemplating using cpan, think hard about trying <code>dh-make-perl</code> instead <img src='http://fosiki.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ideally, CPAN should be able to realise that it can&#8217;t call make if it does not know where it is &#8211; and point this fact out, rather than making it appear as though the package being installed has an issue.</p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F08%2F20%2Fever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc%2F&amp;title=ever+had+Perl+CPAN+not+work+on+your+debian%2C+even+though+you+installed+make+etc%3F" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2008/08/20/ever-had-perl-cpan-not-work-on-your-debian-even-though-you-installed-make-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blead Perl DTrace probes</title>
		<link>http://fosiki.com/blog/2008/02/15/blead-perl-dtrace-probes/</link>
		<comments>http://fosiki.com/blog/2008/02/15/blead-perl-dtrace-probes/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 07:16:26 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[dtrace]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[require]]></category>
		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/15/blead-perl-dtrace-probes/</guid>
		<description><![CDATA[I&#8217;ve ported my additional DTrace probes to blead perl, adding the following probes new-sv and del-sv to track Perl allocations, main-enter and main-exit to show what part of Perl&#8217;s execution phase we&#8217;re in load-module-entry and load-module-return to instrument use, require, do. I&#8217;ve also started to document the probes at http://wikis.sun.com/display/DTrace/perl+Provider To use the patch, get [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:c0a6cc7a492d3b300cf84f711bfe22d8c78cc11d'><p>I&#8217;ve <a href="http://distributedinformation.com/DTrace/">ported my additional DTrace</a> probes to blead perl, adding the following probes</p>
<ul>
<li>new-sv and del-sv to track Perl allocations,</li>
<li>main-enter and main-exit to show what part of Perl&#8217;s execution phase  we&#8217;re in</li>
<li>load-module-entry and load-module-return to instrument use, require, do.</li>
</ul>
<p>I&#8217;ve also started to document the probes at  <a href="http://wikis.sun.com/display/DTrace/perl+Provider" class="moz-txt-link-freetext">http://wikis.sun.com/display/DTrace/perl+Provider</a><br />
To use the patch,</p>
<ol>
<li>get bleadperl:
<ol>
<li> rsync -avz &#8211;exclude .svn/ &#8211;delete rsync://ftp.linux.activestate.com/perl-current/ bleadperl</li>
</ol>
</li>
<li>apply the patch:</li>
<li>cd bleadperl ; patch ../bleadperl.diff</li>
<li>run configure with dtrace enabled:
<ol>
<li>./Configure -de -Dusedevel -Dinc_version_list=none -Dprefix=/usr/local/bleadperl/ -Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib -Uversiononly -Dusedtrace -Doptimize=-g</li>
</ol>
</li>
<li>make</li>
<li>make test</li>
<li>make install</li>
<li>run./perl.d (also found at <a href="http://distributedinformation.com/DTrace/">http://distributedinformation.com/DTrace/</a> ) and then run whatever Perl code you want to instrument.</li>
</ol>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2008/02/15/blead-perl-dtrace-probes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Examining &#8216;use&#8217; and &#8216;require&#8217; with Perl Dtrace</title>
		<link>http://fosiki.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/</link>
		<comments>http://fosiki.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 08:51:59 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[dtrace]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[require]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/</guid>
		<description><![CDATA[Given the following functionally similar Perl modules, I was curious what the internal Perl differences in execution were. To recap &#8211; (from PerlDoc) Perl use &#8211; Imports some semantics into the current package from the named module &#8211; It is exactly equivalent to BEGIN { require Module; Module-&#62;import( LIST ); } Perl require &#8211; demands [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:dd5e8176b78d5e34c1265bd244d42b15712674ef'><p>Given the following functionally similar Perl modules, I was curious what the internal Perl differences in execution were.</p>
<p>To recap &#8211;  (from <a href="http://perldoc.perl.org/index-functions.html">PerlDoc</a>)</p>
<ul>
<li>Perl <em>use</em> &#8211; Imports some semantics into the current package from the named module &#8211;   It is exactly equivalent to
<pre class="verbatim">    BEGIN <span class="s">{</span> <a href="http://perldoc.perl.org/functions/require.html" class="l_k">require</a> <span class="w">Module</span><span class="sc">;</span> <span class="w">Module</span><span class="w">-&gt;import</span><span class="s">(</span> <span class="w">LIST</span> <span class="s">)</span><span class="sc">;</span> <span class="s">}</span></pre>
</li>
<li><span class="s">Perl <em>require</em> &#8211; </span>demands that a library file be included if it hasn&#8217;t already been included. There is pseudocode there to suggest that a previously required module (successful or not) would just return the previous result</li>
</ul>
<p>So given a set of modules that don&#8217;t define an import() function, one would expect that there would be little difference.</p>
<table valign="top" width="100%">
<tr>
<td>use Module</td>
<td>require Module</td>
</tr>
<tr>
<td>
<h3>main.pl</h3>
<p><code>use Module1;<br />
use </code><code>Module2;</code><br />
<code>use </code><code>Module1;      # add multiple use's to attempt to simulate having many use statements throughout many modules</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code><br />
BEGIN {<br />
print "::BEGIN\n";<br />
}</code></p>
<p>Module1::printit();</p>
<h3>Module1.pm</h3>
<p><code>package Module1;</code></p>
<p>BEGIN {<br />
my $test = &#8221;;</p>
<p>print &#8220;<code>Module1</code><code>::BEGIN\n";<br />
}<br />
sub printit {<br />
print "<code>Module1</code><code>::printit\n";</code></code></p>
<p>}<br />
1;</p>
<h3>Module2.pm</h3>
<p><code>package Module2;<br />
use Module1;</code></p>
<p>BEGIN {<br />
print &#8220;Module2::BEGIN\n&#8221;;<br />
}</p>
<p>sub printit {<br />
print &#8220;Module2::printit\n&#8221;;<br />
}</p>
<p>1;</td>
<td>
<h3>main.pl</h3>
<p><code>require</code><code> </code><code>Module1;</code><br />
<code>require MyOtherBegin;<br />
</code><code>require</code><code> </code><code>Module1;</code><br />
<code>require Module1;</code><br />
<code>require Module1;</code><br />
<code>require</code><code> </code><code>Module1;</code><br />
<code>require</code><code> </code><code>Module1;</code><br />
<code>require</code><code> </code><code>Module1;</code><br />
<code><br />
BEGIN {<br />
print "::BEGIN\n";<br />
}</code></p>
<p>MyBegin::printit();</p>
<h3>Module1.pm</h3>
<p><code>package Module1;</code></p>
<p>BEGIN {<br />
my $test = &#8221;;</p>
<p>print &#8220;<code>Module1</code><code>::BEGIN\n";<br />
}</code></p>
<p>sub printit {<br />
print &#8220;<code>Module1::printit\n";</code></p>
<p>}<br />
1;</p>
<h3>Module2.pm</h3>
<p><code>package Module2;<br />
require Module1;</code></p>
<p>BEGIN {<br />
print &#8220;Module2::BEGIN\n&#8221;;<br />
}</p>
<p>sub printit {<br />
print &#8220;Module2::printit\n&#8221;;<br />
}</p>
<p>1;</td>
</tr>
<tr>
<td>
<h3>program output</h3>
<p><code><br />
bash-3.00$ /usr/local/bin/perl main.pl<br />
Module1::BEGIN<br />
Module2::BEGIN<br />
::BEGIN<br />
Module1::printit<br />
</code></td>
<td>
<h3>program output</h3>
<p><code><br />
bash-3.00$ /usr/local/bin/perl main.pl<br />
::BEGIN<br />
Module1::BEGIN<br />
Module2::BEGIN<br />
Module1::printit<br />
</code></td>
</tr>
<tr>
<td>
<h3>dtrace output</h3>
<p><code><br />
== perl ==========================================================<br />
perl*::perl_alloc:main-enter<br />
perl*::perl_alloc:main-exit,  (0/0) (73 uS)<br />
perl*::perl_construct:main-enter<br />
perl*::perl_construct:main-exit,  (12/0) (543 uS)<br />
perl*::perl_parse:main-enter<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (254/2) (3 uS)<br />
--&gt; BEGIN, main.pl<br />
--&gt; BEGIN, Module1.pm<br />
&lt;-- BEGIN, Module1.pm (1/0) (102 uS)<br />
&lt;-- BEGIN, main.pl (60/38) (763 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module2)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module2)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module2.pm) (271/16) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (31/8) (2 uS)<br />
--&gt; BEGIN, Module2.pm<br />
&lt;-- BEGIN, Module2.pm (0/0) (4 uS)<br />
--&gt; BEGIN, Module2.pm<br />
&lt;-- BEGIN, Module2.pm (1/0) (11 uS)<br />
&lt;-- BEGIN, main.pl (67/47) (399 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (285/30) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (299/44) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (313/58) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (327/72) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_utilize:load-module-start (Module1)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (341/86) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_utilize:load-module-start (Module1)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (355/100) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (1/0) (10 uS)<br />
perl*::perl_parse:main-exit,  (373/132) (3464 uS)<br />
perl*::perl_run:main-enter<br />
--&gt; printit, Module1.pm<br />
&lt;-- printit, Module1.pm (0/0) (8 uS)<br />
perl*::perl_run:main-exit,  (0/0) (44 uS)<br />
perl*::perl_destruct:main-enter<br />
perl*::perl_destruct:main-exit,  (0/5) (20 uS)<br />
total, total (0/0) (4177 uS)Subs returned from:<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file<br />
1        8        8        8        8        0        0 printit              Module1.pm<br />
1      102      102      102      102        1        0 BEGIN                Module1.pm<br />
2       15        4        7       11        1        0 BEGIN                Module2.pm<br />
9     1190        3      132      763      128       85 BEGIN                main.pl<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file</code></p>
<p>allocations / deallocations (complete program):<br />
(515 /      222) perl</p>
<p>time to run perl:     6389 uS (time on CPU     4177 uS)</td>
<td>
<h3>dtrace output</h3>
<p><code><br />
== perl ==========================================================<br />
perl*::perl_alloc:main-enter<br />
perl*::perl_alloc:main-exit,  (0/0) (71 uS)<br />
perl*::perl_construct:main-enter<br />
perl*::perl_construct:main-exit,  (12/0) (583 uS)<br />
perl*::perl_parse:main-enter<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (248/2) (3 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module2)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module2.pm) (252/2) (2 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (253/2) (1 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (254/2) (2 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (255/2) (1 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (256/2) (1 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (257/2) (2 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (258/2) (1 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (1/0) (100 uS)<br />
perl*::perl_parse:main-exit,  (285/28) (2319 uS)<br />
perl*::perl_run:main-enter<br />
--&gt; BEGIN, Module1.pm<br />
&lt;-- BEGIN, Module1.pm (1/0) (14 uS)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (69/46) (2 uS)<br />
--&gt; BEGIN, Module2.pm<br />
&lt;-- BEGIN, Module2.pm (1/0) (10 uS)<br />
--&gt; printit, Module1.pm<br />
&lt;-- printit, Module1.pm (0/0) (8 uS)<br />
perl*::perl_run:main-exit,  (99/73) (772 uS)<br />
perl*::perl_destruct:main-enter<br />
perl*::perl_destruct:main-exit,  (0/13) (36 uS)<br />
total, total (0/0) (3814 uS)Subs returned from:<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file<br />
1        8        0        8        8        0        0 printit              Module1.pm<br />
1       10        0       10       10        1        0 BEGIN                Module2.pm<br />
1       14        0       14       14        1        0 BEGIN                Module1.pm<br />
1      100        0      100      100        1        0 BEGIN                main.pl<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file</code></p>
<p>allocations / deallocations (complete program):<br />
(399 /      114) perl</p>
<p>time to run perl:     5368 uS (time on CPU     3814 uS)</td>
</tr>
</table>
<p>The (1/0) tuples in braces are counts of allocations and deallocations by the Perl interpreter in in that enter-return pair, and execution times are all using DTrace&#8217;s vtimestamp, so are adjusted for time on CPU.</p>
<p>This suggests to me that Perl use and require suffer from the same problems that are encountered when using #include&#8217;s inside header files in large scale C and C++, a massive, un-realized parser mess, due to the re-importation of dependencies for the short term convenience of the developer.</p>
<p>While the require output appears better, none the less (looking at the source code for Perl_ck_require) it does more than a nop the second time around (at minimum, its doing a single allocation, and converting the Module name to a File.pm). It is interesting (scary really) that the use case has many more allocations than the require case, but I presume that has to do with the sillyness of importing code into the same namespace several times. That main.pl&#8217;s BEGIN is parsed&amp;allocated for 9 times, and Module2:BEGIN is parsed&amp;allocated for twice &#8211; is not really what I had in mind.</p>
<p>For those of us working with large scale Perl code (in my case TWiki and Catalyst) it seems that there is not enough clarity, and there are opposing concerns for users that run Perl directly, incurring the parse and allocate steps each time, and those using accelerators such as mod_perl and speedy_cgi, who essentially start at the main-run phase (I think).</p>
<p>Reducing the above examples by removing the use or requires from everywhere except the top level main.pl, still shows an unexpected side effect that the use case has 34 more allocations and 26 deallocations &#8211; but&#8230; there is less going on. So it is possible, that the inconvenience of needing to manage the Perl module loading at the top level might be worth while, at least until Perl is changed to do what the &#8216;manual&#8217; implies.</p>
<p>Another interesting side effect of replacing use with require, is that it moves the execution of the BEGIN from the parse phase to the execution phase &#8211; again reducing the effectiveness of Perl accelerators, but perhaps more inline with simplistic expectations.</p>
<p>Seems to me its time to move to bleadperl, and see if I can offer a fix.</p>
<p>The above tests are done using the dtrace enabled Perl 5.8.8  that is in my <a href="http://distributedinformation.com/svn/projects/dtrace/perl-5.8.8/">svn repository</a>.</p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TWiki 4.2.0 OpenIDUserContrib Consumer released.</title>
		<link>http://fosiki.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/</link>
		<comments>http://fosiki.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 07:39:57 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[enterprise]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[twikiapplication]]></category>
		<category><![CDATA[wiki]]></category>
		<category><![CDATA[4.2.0 web2]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[Net::OpenID11]]></category>
		<category><![CDATA[openid consumer]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/</guid>
		<description><![CDATA[I have just uploaded the OpenIDUserContrib for TWiki 4.2.0. It adds OpenID login and 1.1 Attribute functionalty to TWiki. Currently, it disables Registration, and limits authentication to OpenID users. It has the advantage over the OpenIDAuth apache module, that it automatically requests the User&#8217;s OpenId 1.1 attributes like Name, Email address directly from their OpenID [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:fc2c024067f9fe0ecdefe9662c0cb1cbd5adbf61'><p><img src="http://twiki.org/p/pub/Plugins/OpenIDUserContrib/WikiRing-TWiki-OpenID.png" style="margin: 20px; float: right" /></p>
<p>I have just uploaded the <a href="http://twiki.org/cgi-bin/view/Plugins/OpenIDUserContrib">OpenIDUserContrib</a> for TWiki 4.2.0. It adds <a href="http://openid.net" rel="nofollow" target="_top">OpenID</a> login and 1.1 Attribute functionalty to TWiki.</p>
<p>Currently, it disables Registration, and limits authentication to OpenID users.</p>
<p>It has the advantage over the OpenIDAuth apache module, that it automatically requests the User&#8217;s OpenId 1.1 attributes like Name, Email address directly from their OpenID identity.</p>
<p>While it trusts the user&#8217;s choice of &#8216;FullName&#8217; registration attribute when displaying who made changes to topics, the TWiki topic source<br />
actually stores the authenticating OpenID URI, thus their user details will be updated from the authentication server next time they log in.</p>
<p>Note that TWiki Topic based Groups are <em>not</em> yet implemented using this Mapper.</p>
<h3> Future directions</h3>
<ul>
<li> add mixing of UserMappers to allow OpenID and &#8216;normal&#8217; TWiki auth</li>
<li> turn TWiki into an OpenID identity server</li>
<li> add Safe Group definition system</li>
<li> add OpenId to TWiki&#8217;s registration process (would require openid auth first, then prefill registration details from any available attributes
<ul>
<li> This will require re-writing of TWiki&#8217;s inbuilt registration system</li>
</ul>
</li>
<li> move the list of Known users and their mapping information from <code>data/OpenIdUsers.txt</code> to somewhere more scalable. (perhaps DBI)
<ul>
<li> combine the info TWiki uses persistently with the Session and other caching info <span class="twikiNewLink">OpenID11?</span>  uses</li>
</ul>
</li>
</ul>
<h3>Net::OpenID11 (based on Net::JanRain::OpenID)</h3>
<p>To make this work, I fixed the Perl bugs I found in Net::JanRain::OpenID, and renamed the resulting modules under Net::openID11 (as it is not OpenID2.0). I expect to upload these packages to CPAN some time soon.</p>
<p>If you want to take a look at the code &#8211; goto my <a href="http://distributedinformation.com/svn/projects/TWiki/OpenIDUserContrib/">Subversion repository</a></p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl DTrace load-module probe added &#8211; see what module is &#8216;do&#8217;, &#8216;use&#8217; or &#8216;require&#8217;d</title>
		<link>http://fosiki.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/</link>
		<comments>http://fosiki.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 08:45:32 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[dtrace]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/</guid>
		<description><![CDATA[With the load-module probe, you can see at what point modules are loaded using &#8216;do&#8217;, &#8216;use&#8217; or &#8216;require&#8217;. The following code: #!/usr/local/bin/perl -w use strict; my $initial = "there once was a fish. Its feet were small"; my $post = func($initial); my $post2 = func($initial); print "$post\n"; do 'call2.pl'; #eval `cat call2.pl`; #use CGI::Session; sub [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:812a7c86da176fd418e8caf90dfeb28d8cc44ade'><p>With the load-module probe, you can see at what point modules are loaded using &#8216;do&#8217;, &#8216;use&#8217; or &#8216;require&#8217;.</p>
<p>The following code:</p>
<pre>#!/usr/local/bin/perl -w

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
my $post2 = func($initial);
print "$post\n";

do 'call2.pl';
#eval `cat call2.pl`;
#use CGI::Session;

sub func {
    $_[0] =~ s/there/There/;
    return $_[0];
}</pre>
<p>produces the following output:</p>
<pre> == call1.pl ==========================================================
  perl*::perl_alloc:main-enter
  perl*::perl_alloc:main-exit,  (0/0) (56 uS)
  perl*::perl_construct:main-enter
  perl*::perl_construct:main-exit,  (12/0) (624 uS)
  perl*::perl_parse:main-enter
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_utilize:load-module-start (strict)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_ck_require:load-module-start (strict)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_ck_require:load-module-end (strict.pm) (3 uS)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_ck_require:load-module-start (Carp)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_ck_require:load-module-end (Carp.pm) (2 uS)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_dofile:load-module-start (call2.pl)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_dofile:load-module-end (call2.pl) (3 uS)
  perl*::perl_parse:main-exit,  (299/46) (3069 uS)
  perl*::perl_run:main-enter
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_utilize:load-module-start (strict)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_ck_require:load-module-start (strict)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_ck_require:load-module-end (strict.pm) (3 uS)
  perl*::perl_run:main-exit,  (69/45) (533 uS)
  perl*::perl_destruct:main-enter
  perl*::perl_destruct:main-exit,  (0/3) (24 uS)</pre>
<p>see <a href="http://trac.distributedinformation.com/index.cgi/timeline">my perl5.8 trac</a> for the code -or grab <a href="http://distributedinformation.com/svn/projects/dtrace/perl-5.8.8/">the modified 5.8.8 source from svn</a></p>
<p>the  perl*::Perl_utilize:load-module-end probe is currently being worked on, and I really would like to see the actual parse component of the load separated out.</p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+%26%238211%3B+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DTrace shows that readable Perl code is fastest.</title>
		<link>http://fosiki.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/</link>
		<comments>http://fosiki.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 11:16:05 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[dtrace]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[calling conventions]]></category>
		<category><![CDATA[dtrace probes]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/</guid>
		<description><![CDATA[I always wondered why some people write unreadable Perl. The most common reason given seems to be &#8216;Its faster that way&#8217;. And so&#8230; using DTrace, and the extra probes (see the subversion repository with a patched Perl 5.8.8) I added, I thought I&#8217;d take a look. # dtrace -l &#124; grep perl 85614 perl1226 libperl.so [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:3276e6add95c70eb49839b8e4f8185a65c531a92'><p>I always wondered why some people write unreadable Perl. The most common reason given seems to be &#8216;Its faster that way&#8217;.</p>
<p>And so&#8230; using DTrace, and the extra probes (see the <a href="http://distributedinformation.com/svn/projects/dtrace/perl-5.8.8/">subversion repository with a patched Perl 5.8.8</a>) I added, I thought I&#8217;d take a look.</p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
# dtrace -l | grep perl
85614   perl1226        libperl.so                      Perl_sv_free del_sv
85615   perl1226        libperl.so                   Perl_sv_replace del_sv
85616   perl1226        libperl.so                          perl_run main_enter
85617   perl1226        libperl.so                        perl_parse main_enter
85618   perl1226        libperl.so                     perl_destruct main_enter
85619   perl1226        libperl.so                    perl_construct main_enter
85620   perl1226        libperl.so                        perl_alloc main_enter
85621   perl1226        libperl.so                          perl_run main_exit
85622   perl1226        libperl.so                        perl_parse main_exit
85623   perl1226        libperl.so                     perl_destruct main_exit
85624   perl1226        libperl.so                    perl_construct main_exit
85625   perl1226        libperl.so                        perl_alloc main_exit
85626   perl1226        libperl.so                       Perl_sv_dup new_sv
85627   perl1226        libperl.so                      Perl_newSVrv new_sv
85628   perl1226        libperl.so                      Perl_newSVsv new_sv
85629   perl1226        libperl.so                  Perl_newRV_noinc new_sv
85630   perl1226        libperl.so                      Perl_newSVuv new_sv
85631   perl1226        libperl.so                      Perl_newSViv new_sv
85632   perl1226        libperl.so                      Perl_newSVnv new_sv
85633   perl1226        libperl.so                    Perl_vnewSVpvf new_sv
85634   perl1226        libperl.so               Perl_newSVpvn_share new_sv
85635   perl1226        libperl.so                     Perl_newSVhek new_sv
85636   perl1226        libperl.so                     Perl_newSVpvn new_sv
85637   perl1226        libperl.so                      Perl_newSVpv new_sv
85638   perl1226        libperl.so                 Perl_sv_newmortal new_sv
85639   perl1226        libperl.so                Perl_sv_mortalcopy new_sv
85640   perl1226        libperl.so                        Perl_newSV new_sv
85641   perl1226        libperl.so                      Perl_pp_sort sub-entry
85642   perl1226        libperl.so                   Perl_pp_dbstate sub-entry
85643   perl1226        libperl.so                  Perl_pp_entersub sub-entry
85644   perl1226        libperl.so                      Perl_pp_last sub-return
85645   perl1226        libperl.so                    Perl_pp_return sub-return
85646   perl1226        libperl.so                     Perl_dounwind sub-return
85647   perl1226        libperl.so                Perl_pp_leavesublv sub-return
85648   perl1226        libperl.so                  Perl_pp_leavesub sub-return</pre>
<p>Using these probes, we can write some &#8216;D&#8217; that tells us what Perl is doing at each of its phases &#8211; startup, parsing, execution, and cleanup.</p>
<p>First off, accessing function call parameters:</p>
<p>Given <a href="http://distributedinformation.com/svn/projects/dtrace/blog1/">3 essentially identical programs</a></p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
print "$post\n";

sub func {
    $_[0] =~ s/there/There/;
    return $_[0];
}</pre>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
print "$post\n";

sub func {
    my ($val) = @_;
    $val =~ s/there/There/;
    return $val;
}</pre>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
print "$post\n";

sub func {
    my $val = shift;
    $val =~ s/there/There/;
    return $val;
}</pre>
<p>There is a myth that using $_[0] is faster, as it doesn&#8217;t create a temporary variable&#8230;<br />
Dtrace (using the <a href="http://distributedinformation.com/svn/projects/dtrace/blog1/perl.d">general perl stats gathering dtrace script</a>) shows this to be untrue:</p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
== call1.pl ==========================================================
  perl*::perl_alloc:main_enter
  perl*::perl_alloc:main_exit,  (0/0) (53119 nS)
  perl*::perl_construct:main_enter
  perl*::perl_construct:main_exit,  (12/0) (564370 nS)
  perl*::perl_parse:main_enter
   --&gt; BEGIN, ./call1.pl
    --&gt; bits, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- bits, /usr/local/lib/perl5/5.8.8/strict.pm (3/2) (48060 nS)
    --&gt; import, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- import, /usr/local/lib/perl5/5.8.8/strict.pm (1/0) (15398 nS)
   &lt;-- BEGIN, ./call1.pl (160/80) (1025874 nS)
  perl*::perl_parse:main_exit,  (299/42) (2856399 nS)
  perl*::perl_run:main_enter
   --&gt; func, ./call1.pl
   &lt;-- func, ./call1.pl (1/0) (47723 nS)
  perl*::perl_run:main_exit,  (0/1) (265677 nS)
  perl*::perl_destruct:main_enter
  perl*::perl_destruct:main_exit,  (0/2) (20763 nS)
total, total (0/0) (3789064 nS)
== call2.pl ==========================================================
  perl*::perl_alloc:main_enter
  perl*::perl_alloc:main_exit,  (0/0) (53251 nS)
  perl*::perl_construct:main_enter
  perl*::perl_construct:main_exit,  (12/0) (509684 nS)
  perl*::perl_parse:main_enter
   --&gt; BEGIN, ./call2.pl
    --&gt; bits, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- bits, /usr/local/lib/perl5/5.8.8/strict.pm (3/2) (36748 nS)
    --&gt; import, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- import, /usr/local/lib/perl5/5.8.8/strict.pm (1/0) (9797 nS)
   &lt;-- BEGIN, ./call2.pl (160/80) (924250 nS)
  perl*::perl_parse:main_exit,  (299/38) (2545953 nS)
  perl*::perl_run:main_enter
   --&gt; func, ./call2.pl
   &lt;-- func, ./call2.pl (1/0) (42165 nS)
  perl*::perl_run:main_exit,  (0/1) (142393 nS)
  perl*::perl_destruct:main_enter
  perl*::perl_destruct:main_exit,  (0/2) (20851 nS)
total, total (0/0) (3301007 nS)
== call3.pl ==========================================================
  perl*::perl_alloc:main_enter
  perl*::perl_alloc:main_exit,  (0/0) (52927 nS)
  perl*::perl_construct:main_enter
  perl*::perl_construct:main_exit,  (12/0) (607783 nS)
  perl*::perl_parse:main_enter
   --&gt; BEGIN, ./call3.pl
    --&gt; bits, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- bits, /usr/local/lib/perl5/5.8.8/strict.pm (3/2) (37066 nS)
    --&gt; import, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- import, /usr/local/lib/perl5/5.8.8/strict.pm (1/0) (10171 nS)
   &lt;-- BEGIN, ./call3.pl (160/80) (924824 nS)
  perl*::perl_parse:main_exit,  (297/37) (2543981 nS)
  perl*::perl_run:main_enter
   --&gt; func, ./call3.pl
   &lt;-- func, ./call3.pl (1/0) (41833 nS)
  perl*::perl_run:main_exit,  (0/1) (140527 nS)
  perl*::perl_destruct:main_enter
  perl*::perl_destruct:main_exit,  (0/2) (20273 nS)
total, total (0/0) (3395310 nS)

allocations / deallocations:
     474 /      122 call3.pl
     476 /      123 call2.pl
     476 /      127 call1.pl</pre>
<p>Counting up the number of allocations and deallocations in the (0/1) output &#8211; and<br />
&#8220;&lt;&#8211; func, ./call2.pl (1/0) &#8221; is always the same&#8230; one allocation.</p>
<p>After all the test runs, I also print out the total allocations for the script,<br />
and it seems that the &#8220;my $val = shift&#8221; version is the most efficient -<br />
using two fewer allocations (apparently during the parse phase).</p>
<p>The deallocation count is interesting too &#8211; with &#8220;$_[0]&#8221; using 5 more deallocations during<br />
the parse phase and &#8220;my ($val) = @_;&#8221; using one more than the &#8220;my $val = shift&#8221; option.</p>
<p>In an attempt to reduce the allocations doesn&#8217;t seem to help &#8211; the following code resulting in 474 allocations,<br />
shift case, but with 3 extra deallocations, again in the parsing phase. Increasing the number of times that func<br />
is called only increases the benefits of using shift.</p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
$_ = $initial;
my $post = func();
print "$post\n";

sub func {
    s/there/There/;
    return $_;
}</pre>
<p>Interestingly, &#8220;my $val = shift&#8221;  is not only the fastest of the conventions tested, but it also seems that none of the conventions tested cause allocations at run time &#8211; they are all done during the parse phase. I guess I&#8217;ll have to construct a more complex case, using references / hashes &#8211; next time <img src='http://fosiki.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows installer of TWiki 4.2 rc2 that uses Strawberry perl 5.10 beta 2</title>
		<link>http://fosiki.com/blog/2007/12/22/windows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2/</link>
		<comments>http://fosiki.com/blog/2007/12/22/windows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 04:01:34 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[wiki]]></category>
		<category><![CDATA[installer]]></category>
		<category><![CDATA[perl 5.10]]></category>
		<category><![CDATA[strawberry perl]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2007/12/22/windows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2/</guid>
		<description><![CDATA[For the extremely adventurous &#8211; I have built an installer using Strawberry Perl 5.10 beta2 &#8211; TWiki-4.2.0-rc2.1-strawberry.exe Warning: Search does not work, and needs someone to debug it (I&#8217;m away over xmas)]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:1d9ba1ba07f14869cc5345fea31375dc1cf3c0ba'><p>For the extremely adventurous &#8211; I have built an installer using <a href="http://win32.perl.org/">Strawberry Perl</a> 5.10 beta2 &#8211; <a href="http://distributedinformation.com/TWikiInstallers/TWiki-4.2.0-rc2.1-strawberry.exe">TWiki-4.2.0-rc2.1-strawberry.exe</a></p>
<p>Warning: Search does not work, and needs someone to debug it (I&#8217;m away over xmas)</p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F22%2Fwindows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2%2F&amp;title=Windows+installer+of+TWiki+4.2+rc2+that+uses+Strawberry+perl+5.10+beta+2" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2007/12/22/windows-installer-of-twiki-42-rc2-that-uses-strawberry-perl-510-beta-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new begining for Perl and DTrace?</title>
		<link>http://fosiki.com/blog/2007/12/19/a-new-begining-for-perl-and-dtrace/</link>
		<comments>http://fosiki.com/blog/2007/12/19/a-new-begining-for-perl-and-dtrace/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 09:02:19 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
				<category><![CDATA[dtrace]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2007/12/19/a-new-begining-for-perl-and-dtrace/</guid>
		<description><![CDATA[I&#8217;ve just created a subversion repository with perl 5.8.8, and the accumulated DTrace patches &#8211; including the using is-enabled to reduce the performance impact of the Probes when disabled. Byran and I, (and anyone else that would like to help) will be working slowly towards making Perl a first class DTrace citizen over the coming [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:15ef432a569f0c064cff42698398e10e35858dae'><p>I&#8217;ve just created a <a href="http://distributedinformation.com/svn/projects/dtrace/" title="Perl 5.8.8 with DTrace">subversion repository</a> with perl 5.8.8, and the accumulated DTrace patches &#8211; including the using is-enabled to reduce the performance impact of the Probes when disabled. <a href="http://mirrorshades.org/overflow/">Byran</a> and I, (and anyone else that would like to help) will be working slowly towards making Perl a first class DTrace citizen over the coming months. Next stop &#8211; <a href="http://gisle.aas.no/perl/illguts/">Perl Guts Illustrated</a></p>
<p>Of course, we&#8217;ll also port it all to Perl 5.10 &#8211; the 20th anniversary release <img src='http://fosiki.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>
<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ffosiki.com%2Fblog%2F2007%2F12%2F19%2Fa-new-begining-for-perl-and-dtrace%2F&amp;title=A+new+begining+for+Perl+and+DTrace%3F" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://fosiki.com/blog/2007/12/19/a-new-begining-for-perl-and-dtrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.442 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-03 10:43:05 -->
