*{"$target\::nx"} = do { package soemthing; sub { do_something() } } ... The problem seems to be that your anonymous sub remembers where it was first compiled.
I'd recommend doing this job with Exporter though. Is there some reason that doesn't fit? (Probably because it would use the master namespace, now that I think about it.)
-Paul
In reply to Re: Defining a function in the caller's package
by jettero
in thread Defining a function in the caller's package
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |