<?xml version="1.0" encoding="windows-1252"?>
<node id="966768" title="Re: my and local variable significance in a particular case" created="2012-04-24 05:31:25" updated="2012-04-24 05:31:25">
<type id="11">
note</type>
<author id="757127">
tobyink</author>
<data>
<field name="doctext">
&lt;code&gt;
$x = "x";
$y = "y";

sub uc_call {
	my $x    = uc $x;
	local $y = uc $y;
	shift-&gt;();
}

my $code = sub { print "$x $y\n" };
uc_call($code);
&lt;/code&gt;

&lt;p&gt;The above prints lower-case "x" but upper-case "Y", which illustrates that even without strictures, there's a difference between &lt;c&gt;local&lt;/c&gt; and &lt;c&gt;my&lt;/c&gt;.&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-757127"&gt;
&lt;small&gt;&lt;small&gt;
&lt;tt&gt;perl -E'sub Monkey::do{say$_,for@_,do{($monkey=&amp;#x5B;caller(0)]-&gt;&amp;#x5B;3])=~s{::}{ }and$monkey}}"Monkey say"-&gt;Monkey::do'
&lt;/tt&gt;&lt;/small&gt;&lt;/small&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
966719</field>
<field name="parent_node">
966719</field>
</data>
</node>
