<?xml version="1.0" encoding="windows-1252"?>
<node id="224951" title="Re: MOPT-04 - identification, part 2" created="2003-01-07 07:53:48" updated="2005-08-15 08:43:36">
<type id="11">
note</type>
<author id="170000">
Courage</author>
<data>
<field name="doctext">
I have a correction to your first part of a message&lt;br&gt;
&lt;i&gt;Perl's function bindings are statically scoped, not dynamically scoped, so we can't bind the name to a new entity in a different evaluation context. If we want to play with dynamically scoped entities in Perl, we have to stick to local variables. &lt;/i&gt;
&lt;p&gt;Actually you can redefine subroutine by using 
&lt;code&gt;eval "sub func {'...'}"&lt;/code&gt;
and better yet is just to use anonymous subroutines and use ordinary variables to switch between different ones:
&lt;code&gt;
my $func = sub {
  return "value";
};
$func-&gt;();
$func = sub {
  return "another value";
};
$func-&gt;();
&lt;/code&gt;
&lt;p&gt;[Courage], the Cowardly Dog</field>
<field name="root_node">
224813</field>
<field name="parent_node">
224813</field>
</data>
</node>
