But this assumes that *x is declared within the same package as a() and b().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();
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.
In reply to Re: my sub ?
by broquaint
in thread my sub ?
by bcrowell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |