caller always returns the package where the code was, regardless of which name in which package you used to call the code.
I see, this explains why my first attempt had to fail.
Actually, the reference you gave was very helpful, because what my do_something *really* does, is to call NEXT(). I just left out this detail because I thought it would not be relevant to the problem.
I just wonder whether fiddling around with __ANON__, as shown in the example you refered to, is considered portable Perl style (I couldn't find any "official" Perl documentation about __ANON__), or whether the eval solution I used would be better. Both seem to be a hack, but which one is the kinder hack ?-)
In reply to Re^2: Defining a function in the caller's package
by rovf
in thread Defining a function in the caller's package
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |