note
educated_foo
That's your problem: <code>my</code> makes a variable lexical, and symbolic references only work with dynamic/global variables. BTW, this is also why mixing <code>eval STRING</code> with lexicals is problematic:
<code>
foobar:perl/blead% perl -le '$y="print \$x"; $z=sub { my $x=23; $y}; eval $z->()'
foobar:perl/blead% perl -le '$y="print \$x"; $z=sub { $x=23; $y}; eval $z->()'
23
</code>
952446
952792