(I should stop answering my own posts ;-)
At 11:55 +0200 10/20/03, Elizabeth Mattijsen wrote:
>Hmmm... both of the following return correct results also:
The problem can be simplified to the following code:
my $foo = 'foo';
my $get = sub () {$foo};
my $set = sub ($) {$foo = $_[0]};
$set->('bar');
print "foo = $foo = ".$get->()."\n";
__END__
foo = bar = foo
so this looks like an optimizer problem to me: the $get sub is
referring to something else than the package lexical $foo.
Liz