in reply to Re: Perl scoping not logical...?
in thread Perl scoping not logical...?

Yeah...not my intent. I was trying for a non-closure, lexically scoped, named-function, but got stuck with the "if named(sub) then must be global", limitation in perl5 (maybe perl6 allows lexically scoped, *named* subs?)


-linda

Replies are listed 'Best First'.
Re^3: Perl scoping not logical...?
by John M. Dlugosz (Monsignor) on May 01, 2008 at 23:38 UTC
    Ah yes, writing a named sub in Perl 5 does not interact in the expected way with the context.

    In Perl 6, you can nest subs, no problem. They find the proper variable in their active caller, if you refer to one.