I was asked about the possibility of using our $inner; instead of my $inner;. It's doable.
sub outer { ... local our $helper; $helper = sub { ... $helper->(...); ... }; $helper->(@_); }
local still needs to be used to protect the current value of the variable and to clear the reference to the helper sub when outer exits.
I don't see any advantage in localizing $helper instead of &helper.
In reply to Re: Creating Nested Functions
by ikegami
in thread Creating Nested Functions
by ikegami
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |