in reply to my sub ?

If you define a sub within a sub it unfortunately gets imported into the the current package's symbol table. A possible solution would be
use strict; sub x { print "x() in main::\n"; } sub a { local *x = sub { print "x() in a()\n"; }; x(); } sub b { local *x = sub { print "x() in b()\n"; }; x(); } &a(); &b(); &x();
But this assumes that *x is declared within the same package as a() and b().
HTH

broquaint

update [2002-05-20]: you could also check out the beginnings of a small module that attempts to give the illusion of having lexically scoped subs.