note
BrowserUk
<blockquote><i></i></blockquote>
<p>Like this maybe?
<code>
sub a{ print 'from a'; undef $_ };;
sub b{ print 'from b'; undef $_ };;
@r = ( \&a, \&b );;
$_->( 1 ) for @r;;
from a
from b
$_->( 1 ) for @r;;
Use of uninitialized value in subroutine entry at (eval 13)
Undefined subroutine &main:: called at (eval 13)
</code>
<P>Basically $_ becomes an alias to the stored coderef. If the code called assigns to $_ without localising it, the coderef will be overwritten.
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.</div>
</font>
</div></div>
909229
909229