in reply to Re: Concurrent lexical scopes?
in thread Concurrent lexical scopes?

The namespace issue has nothing to do with the coderefs
It does because the 'lexical subs' are stored in coderefs which are just scalars and you can't have 2 scalars of the same name in the same lexical scope e.g
my $foo = "I'm a string"; # this will replace previous $foo my $foo = sub { "I'm a coderef" };
the problem is that lexical variables (and by abstraction lexical subs too) are not in any namespace at all!
Yes they are and it is the current lexical scope's namespace (which is anonymous and inaccessible through straight perl).

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Re: Concurrent lexical scopes?
by Joost (Canon) on Jun 11, 2002 at 14:00 UTC
    You're right. I guess I'm a little more tired than I thought :-)

    Anyway, I guess you're sort of stuck then. The only thing I can think of, is to use something a little more descriptive than $__name__ - how about $__lex_sub__name ?

    I think it would be quite reasonable to disallow the use of scalars called $__lex_sub__* in combination with your module.

    -- Joost downtime n. The period during which a system is error-free and immune from user input.