<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Interesting Perl Behavior</title>
	<atom:link href="http://www.dangoldin.com/2008/05/30/interesting-perl-behavior/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dangoldin.com/2008/05/30/interesting-perl-behavior/</link>
	<description>My thoughts and musings</description>
	<lastBuildDate>Mon, 10 Jan 2011 08:03:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mark Tiefenbruck</title>
		<link>http://www.dangoldin.com/2008/05/30/interesting-perl-behavior/comment-page-1/#comment-5</link>
		<dc:creator>Mark Tiefenbruck</dc:creator>
		<pubDate>Tue, 05 Aug 2008 21:24:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.dangoldin.com/blog/?p=17#comment-5</guid>
		<description>They&#039;re not global. They&#039;re still limited in scope. The value just doesn&#039;t get reset when the same scope is entered more than once. Although known for years, it&#039;s been kept because, instead of reporting it as a bug, people started using this to implement static variables. It certainly wasn&#039;t smart, but that&#039;s what happened, and now we&#039;re stuck with it. Perl 6 will probably fix it.</description>
		<content:encoded><![CDATA[<p>They&#8217;re not global. They&#8217;re still limited in scope. The value just doesn&#8217;t get reset when the same scope is entered more than once. Although known for years, it&#8217;s been kept because, instead of reporting it as a bug, people started using this to implement static variables. It certainly wasn&#8217;t smart, but that&#8217;s what happened, and now we&#8217;re stuck with it. Perl 6 will probably fix it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zbigniew Lukasiak</title>
		<link>http://www.dangoldin.com/2008/05/30/interesting-perl-behavior/comment-page-1/#comment-4</link>
		<dc:creator>Zbigniew Lukasiak</dc:creator>
		<pubDate>Tue, 05 Aug 2008 18:20:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.dangoldin.com/blog/?p=17#comment-4</guid>
		<description>&lt;blockquote&gt;NOTE: The behaviour of a my statement modified with a statement modifier conditional or loop construct (e.g. my $x if ... ) is undefined. The value of the my variable may be undef, any previously assigned value, or possibly anything else. Don&#039;t rely on it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons.
&lt;/blockquote&gt; from http://perldoc.perl.org/perlsyn.html

Cheers,
Z.</description>
		<content:encoded><![CDATA[<blockquote><p>NOTE: The behaviour of a my statement modified with a statement modifier conditional or loop construct (e.g. my $x if &#8230; ) is undefined. The value of the my variable may be undef, any previously assigned value, or possibly anything else. Don&#8217;t rely on it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons.
</p></blockquote>
<p> from <a href="http://perldoc.perl.org/perlsyn.html" rel="nofollow">http://perldoc.perl.org/perlsyn.html</a></p>
<p>Cheers,<br />
Z.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt S Trout</title>
		<link>http://www.dangoldin.com/2008/05/30/interesting-perl-behavior/comment-page-1/#comment-3</link>
		<dc:creator>Matt S Trout</dc:creator>
		<pubDate>Tue, 05 Aug 2008 16:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.dangoldin.com/blog/?p=17#comment-3</guid>
		<description>That&#039;s a -sort of- bug.

perl 5.10 actually throws a warning when you trip it, and provides a &#039;state $x&#039; keyword that provides the same functionality as &#039;my $x if 0&#039; safely.

The basic problem is that the &#039;my&#039; causes a lexical pad entry to be generated at compile time, but because the if 0 prevents the statement running at runtime it doesn&#039;t get reinitialised on your way round the loop.</description>
		<content:encoded><![CDATA[<p>That&#8217;s a -sort of- bug.</p>
<p>perl 5.10 actually throws a warning when you trip it, and provides a &#8216;state $x&#8217; keyword that provides the same functionality as &#8216;my $x if 0&#8242; safely.</p>
<p>The basic problem is that the &#8216;my&#8217; causes a lexical pad entry to be generated at compile time, but because the if 0 prevents the statement running at runtime it doesn&#8217;t get reinitialised on your way round the loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo</title>
		<link>http://www.dangoldin.com/2008/05/30/interesting-perl-behavior/comment-page-1/#comment-6</link>
		<dc:creator>Ricardo</dc:creator>
		<pubDate>Tue, 05 Aug 2008 16:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.dangoldin.com/blog/?p=17#comment-6</guid>
		<description>It seems like something like &quot;(my if (0)) $val = 0&quot; is going on. It&#039;s weird.</description>
		<content:encoded><![CDATA[<p>It seems like something like &#8220;(my if (0)) $val = 0&#8243; is going on. It&#8217;s weird.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

