sub outer { my $c_inner = sub { print "perl" }; $c_inner->(); }
Please note that Python is implicitly preferring references while Perl prefers the "Explicit is better than implicit" approach (yes it's ironic)
> Python has Local, Enclosing, Global and Built-in variables.
More or less: *
> It was this video that promoted my thinking on this. https://www.youtube.com/watch?v=QVdf0LgmICw
Not linkified not watched.²
Hint: Please provide code examples if you want better answers.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
°) There was an experimental attempt to allow "private subs" in Perl, which was essentially syntactic sugar for the following IIRC. No idea if it's still available or deprecated.
*) the py-docs are sparse and incomplete here. Variable declarations in class context become attributes. These are essentially package vars in Perl. (Python has no package and Perl has no class )
²) tried to, but won't watch a 20 min video to guess what your question is.
³) updated, see Re^7: Nesting Functions for details
In reply to Re: Nesting Functions
by LanX
in thread Nesting Functions
by betmatt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |