On 2010-11-29 10:22, Dave Mitchell wrote: > On Sun, Nov 28, 2010 at 05:16:28PM -0800, Father Chrysostomos wrote: >> I know this is what constant.pm used to use, but it causes a bug: > > What do you think is the bug? It seems to be behaving the way I expect. > >> $ perl -MO=Deparse -e' BEGIN{my $x = 5; *foo = sub(){$x}; $x=6} print foo' >> sub BEGIN { >> my $x = 5; >> *foo = sub () { >> $x; >> } >> ; >> $x = 6; >> } >> print 5; The compiler should patch the constsub at the '$x = 6' line. -- RuudThread Previous | Thread Next