λΣΤΑΤΙ, οξ ε³ ξε χιδιτ<br>#!/usr/bin/perl<br><br>use strict;<br>use warnings;<br><br>my $test = 10;<br>warn &#39;main: &#39;, \$test;<br><br>my $func1 = sub {<br>&nbsp;&nbsp;&nbsp; warn &#39;func1: &#39;, \$test;<br>&nbsp;&nbsp;&nbsp; sub func2 {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; warn &#39;func2: &#39;, \$test;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $test = 5000;<br>&nbsp;&nbsp;&nbsp; }<br>};<br>$func1-&gt;();<br>func2();<br>func2();<br>func2();<br>func2();<br>func2();<br>func2();<br>warn $test;<br><br><br>main: SCALAR(0x182f478) at 1.pl line 7.<br>func1: SCALAR(0x182f478) at 1.pl line 10.<br>
func2: SCALAR(0x182f3d0) at 1.pl line 12.<br>func2: SCALAR(0x1854628) at 1.pl line 12.<br>func2: SCALAR(0x182f3d0) at 1.pl line 12.<br>func2: SCALAR(0x1854628) at 1.pl line 12.<br>func2: SCALAR(0x182f3d0) at 1.pl line 12.<br>
func2: SCALAR(0x1854628) at 1.pl line 12.<br>10 at 1.pl line 23.<br><br>