note
Ovid
<p>My most common use of [local] deals with recursive method calls:</p>
<code>sub foo {
my $self = shift;
local $self->{some_val} = $self->get_val;
# do a bunch of stuff
$self->foo;
}</code>
<p>This seems strange, but I do find this useful at times. It allows me to temporarily overwrite a value which needs to be preserved for a given stack frame.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-17000">
<p>Cheers,<br />
<a href="/index.pl?node=Ovid&lastnode_id=1072">Ovid</a></p>
<p><small>New address of <a href="http://users.easystreet.com/ovid/cgi_course/">my CGI Course</a>.</small></p>
</div></div>
513294
513294